Message 1 of 2
Sketch.profiles and extrusion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying the following code.The problem here is that the profiles contains inner profileLoops. Is there any way to filter that out, or should I create another profile and includes only the outer profile in profileLoops? This sounds very confusing to me.
# search for profiles that spans larger boxes than registered maxp newprofiles = {} for p in sketch.profiles: if not p.isValid: continue bbox = p.boundingBox d = helper.diff(bbox.minPoint,bbox.maxPoint) # diffs two points and returns vector if d.length > maxp[0]: newprofiles[d.length] = p # sort and pick the largest 3 largest = [] for a in sorted(newprofiles, reverse=True): if len(largest) < 3: largest.append(newprofiles[a]) else: break pedestal = largest[0] einput = extrudes.createInput( pedestal, adsk.fusion.FeatureOperations.NewBodyFeatureOperation) distance = adsk.core.ValueInput.createByReal(-stepdown) einput.setDistanceExtent(False,distance) extrudes.add(einput)
As a result, all profiles are chosen instead of the outermost one (which would span the largest bounding box). See the screenshot