Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello to all you wonderful python coders! I am needing assistance in merging (or projecting) existing sketches for a model, and then saving it to a DXF file in python NOT the UI. At present, I am able to make a DFX file for each sketch, but am not able to find any python code that allows me to append/merge them into one sketch that can then be saved as a DXF.
For each model, a variable amount of sketches are automatically created. For one example when I expand the UI "Sketches" I see three subcomponents (sketches) named ID-OD, Notches and Center-Hole. If I use the following code I can make a dxf file for each... ID-OD, Notches and Center-Hole:
des: adsk.fusion.Design = app.activeProduct
root: adsk.fusion.Component = des.rootComponent
skt = root.sketches.itemByName('ID-OD')
skt2 = root.sketches.itemByName('Notches')
skt3 = root.sketches.itemByName('Center-Hole')
skt.saveAsDXF(fullPath + '.dxf') and so on.
First question is : Each model will have different sketch names (ie. ID-OD) how to I query the model/sketches to get a list of the sketch names so I can use it in a variable like... skt = root.sketches.itemByName(first_sketch_name)
Second question is : How do I combine/merge/append skt, skt2 and skt3 together ? There have been other posts that say make a new sketch and project the sketches into it, but they are all talking UI.
Thank you in advance for your time and knowledge!
Solved! Go to Solution.