-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening and adding an instance of a family table #22
Comments
The constraints are supposed to be an array of JLConstraint objects - see the creoson functions doc if you have access to it (by default it is at http://localhost:9056/functions.html if creoson is running) JLConstraint has the following properties: An example of specifying a CSYS constraint using JSON (I don't know how you'd specify it using creopyson): |
Thank you for reply. |
I think the source code predates the existence of component interfaces, so
there isn't any provision for them in the code. But I've never played
around with component interfaces myself.
…On Wed, Jan 27, 2021 at 2:38 PM stekicar ***@***.***> wrote:
Thank you for reply.
I can make JSON object in python to look exactly like your example. Is
there any option to select existing component interface instead? This is
because my part is family table and component intercase is already set.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANPKPBBCWUDMPSED2UCBLLS4BTTLANCNFSM4WVFFNEQ>
.
|
Ok. Thank you for your reply! |
Hi |
Will try! Thank you! |
I'm not sure I understand all your questions but i'll try to answer: in order to format your code in you first message you should put:
|
What about generic=None option? I thought I need to put generic file name there. When I do that, code does not work. |
In creoson, the "file" option is supposed to be the instancename+fileext
and the "generic" option is supposed to be the base name. For example if
you have a part "bracket.prt" which contains a family table, and there is
an entry in the table named "wide_bracket" then you would set
file="wide_bracket.prt" and generic="bracket". (which may seem backwards).
At least that's how it works for the file-open function. The file-assemble
should work the same way.
…On Wed, Jan 27, 2021 at 3:11 PM stekicar ***@***.***> wrote:
What about generic=None option? I thought I need to put generic file name
there. When I do that, code does not work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANPKPDBLRUW5WYDB3JIYL3S4BXO5ANCNFSM4WVFFNEQ>
.
|
Well, it does not. I did what you just explained but if fails. If I put absolute file path for "file", such as for ex. r'Y:\0_CREO\STD_COMPONENTS\FASTENERS\M14X2X20<DIN912_SHCS_BOLT>.prt' and dir_name folder, it works. If I add r'Y:\0_CREO\STD_COMPONENTS\FASTENERS\DIN912_SHCS_BOLT.prt' for generic, for some reason it does not work. Of course, instance name is M14X2X20.prt. |
if you want test with "vanilla" creoson, you can use
where command should be
|
Ok. Will do. |
is it ok? |
I have not tried "vanilla" version yet. |
I added some doc for vanilla version and logging if it can help |
Thank you. |
Creopyson version: 0.6
Creoson version: 2.7.0
Python version: 3.8.7
Operating System: Win7
Description
I add an instance of family table in assembly like this:
Although I have dir_name I do not use it and code still works.
dir_name=Z:\D\0_CREO_TEMP\FINAL instance_file_name=Z:\D\0_CREO_TEMP\FINAL\DOWEL_6X22<metric_dowel_family_table>.prt creopyson.file.assemble(c, instance_file_name, dirname=None, generic=None, into_asm=None, path=None, ref_model=None, transform=None, constraints=None, package_assembly=None, walk_children=None, assemble_to_root=None, suppress=None)
If I want to open instance of family table I will have to use dir_name in code:
opened_comp = creopyson.file_open(c, instance_file_name, dirname=dir_name, display=False, new_window=True)
Otherwise it will not work unless working directory is folder where my family table reside. This is expected.
What I Did
I tried to separate each variable: file_name as instance name, dirname as dir_name and generic as (family table) generic_file_name:
dir_name=Z:\D\0_CREO_TEMP\FINAL instance_file_name=DOWEL_6X22.prt generic_file_name=Z:\D\0_CREO_TEMP\FINAL\metric_dowel_family_table.prt creopyson.file.assemble(c, instance_file_name, dirname=dir_name, generic=generic_file_name, into_asm=None, path=None, ref_model=None, transform=None, constraints=None, package_assembly=None, walk_children=None, assemble_to_root=None, suppress=None)
But this does not work for me.
Is this how it should work?
One more thing. How to use variable "constraints" in creopyson.file.assemble? I just put name of component interface but it did not work. Is this used to tell Creo what component interface to use when placing instance in assembly or for something else?
Note: Code formatting does not work properly on github. Everything shows up in one line.
Thank you for your help!
The text was updated successfully, but these errors were encountered: