Message 1 of 3
Not applicable
02-25-2016
01:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to extrude from a sketch that belongs to a component that has a non-standard origin
The origin has the y and z axes switched and is translated <1,1,1>. This is shown in the figure below.
I'm using this code to create the extrusion and get the error posted below:
boltComp = self.RWO
boltSketches = boltComp.sketches
# reportMessageBox("building bolt", ("random"))
xyPlane = boltComp.xYConstructionPlane
planes = boltComp.constructionPlanes
planeInput = planes.createInput()
#offset plane example
offsetValue = adsk.core.ValueInput.createByReal(0);
planeInput.setByOffset(xyPlane, offsetValue)
plane = planes.add(planeInput)
sketch = boltSketches.add(plane)
center = boltComp.originConstructionPoint.geometry
vertices = []
for i in range(0, 6):
vertex = adsk.core.Point3D.create(center.x + (self.hDiameter/2) * math.cos(math.pi * i / 3), center.y + (self.hDiameter/2) * math.sin(math.pi * i / 3),0)
vertices.append(vertex)
for i in range(0, 6):
sketch.sketchCurves.sketchLines.addByTwoPoints(vertices[(i+1) %6], vertices[i])
extrudes = boltComp.features.extrudeFeatures
prof = sketch.profiles[0]
extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
distance = adsk.core.ValueInput.createByReal(self.hHeight)
extInput.setDistanceExtent(True, distance)
headExt = extrudes.add(extInput)Solved! Go to Solution.
