Skip to content
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

Automate drawings of family table instances #44

Open
RandomFab opened this issue Feb 5, 2022 · 2 comments
Open

Automate drawings of family table instances #44

RandomFab opened this issue Feb 5, 2022 · 2 comments

Comments

@RandomFab
Copy link

  • Creo version: 7
  • Creopyson version:
  • Creoson version:
  • Python version: 3.9
  • Operating System: windows

Description

I'm definetly not an expert in python and coding in general, so please be indulgent if i'm doing BIG mistakes !
Description ->
I have designed a generic part and have created its family table on creo. I have done a drawing based on the generic part. I want to generate a drawing for every single instance of my generic part.

On creo you can manually "replace" the drawing model by the instance that you want. I basically try to do the same with creopyson.

What I Did

I tried :

c.drawing_set_cur_model("part0001_inst2.prt")
[...]
RuntimeError: File 'part0001_inst2.prt' was not open

c.drawing_set_cur_model("PRT0001_INST2.prt")
[...]
RuntimeError: A Pro/TOOLKIT error has occurred: Not Found. Check your model/drawing for accuracy.

I'm not sure about what i'm doing rn. So please, if you have any idea or advices, do not hesitate !

@davidhbigelow
Copy link

davidhbigelow commented Feb 5, 2022 via email

@Zepmanbc
Copy link
Owner

Zepmanbc commented Feb 8, 2022

Hello @RandomFab
@davidhbigelow is right, template is the best practice.
But I think t\you must be very strict with your model to use «build dimensions» (sorry don't know the exact word in english) to auto complete the drw.
You should try to do a mapkey that changes your model in the drawing.
After that you can change the code with the list of names in your family table.
to use mapkey: https://creopyson.readthedocs.io/en/latest/creopyson.html#creopyson.connection.Client.interface_mapkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants