Looking for some help to loop through imported dxf layers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there
What I'm trying to do with fusion
- Import in dxf's
- Extrude them using api
What my problem is
I'm not a coder, this is a side project I do in my spare time. I'll show my problem then explain
pcb_profiles1 = sketches.item(0).profiles.item(0)
pcb_profiles2 = sketches.item(0).profiles.item(1)
pcb_profiles3 = sketches.item(0).profiles.item(2)
pcb_profiles4 = sketches.item(0).profiles.item(3)
pcb_profiles5= sketches.item(0).profiles.item(4)
pcb_profiles6 = sketches.item(0).profiles.item(5)
pcb_profiles7 = sketches.item(0).profiles.item(6)
pcb_profiles8 = sketches.item(0).profiles.item(7)
- My problem is that this code works for my testing dxf as it has 7 geomtries on the dxf layer, but if I bring in another dxf one that doesn't have 7 geometries on this layer then my code doesn't work
What I'm trying to do to fix this problem
I would like to be able to loop through the layer so that if I had 1 geometry or 100 geometries the code would work
something along the lines of
pcb_profiles1 = sketches.item(0).profiles.item(1)
pcb_profiles+1 = sketches.item(0).profiles.item(+1)
I know this isn't the correct way but it shows what I would like
Any Help would be much appreciated