I'm usingin the following code to create a construction point that I will use to create a plane by 3 Points. But the rwohPoint is null when the input is added. What would cause this failure. I know the input point is valid and everything is in the context of the rootComponent so no occurence should be needed.
points = self.design.rootComponent.constructionPoints pointInput = points.createInput() rwohDirectionPoint = adsk.core.Point3D.create(point.x+rwohDirection.x, point.y+rwohDirection.y, point.z+rwohDirection.z) self.ui.messageBox("rwohDirectionPoint: "+str(rwohDirectionPoint.asArray())) pointInput.setByPoint(rwohDirectionPoint) self.ui.messageBox("Valid?: "+str(pointInput.isValid)) rwohPoint = points.add(pointInput) self.ui.messageBox("rwohPoint:"+str(rwohPoint)) # rwohPoint = rwohPoint.createForAssemblyContext(occ) pointInput = points.createInput() newDirectionPoint = adsk.core.Point3D.create(point.x+self.normal.x, point.y+self.normal.y, point.z+self.normal.z) pointInput.setByPoint(newDirectionPoint) newPoint = points.add(pointInput) # newPoint = newPoint.createForAssemblyContext(occ) planes = self.design.rootComponent.constructionPlanes planeInput = planes.createInput() planeInput.setByThreePoints(originProxy, rwohPoint, newPoint) planes.add(planeInput)
Solved! Go to Solution.
Solved by ekinsb. Go to Solution.
Is the design you're trying to create the point set to be parametric (capture design history) or direct modeling (do not capture design history)?
When you create construction geometry of any kind in direct modeling mode, it has no relationship to anything else and is positioned in space. You can use the Move command to reposition it anywhere in the model. When working in a parametric model, the construction geometry remembers the input geometry and is tied to it. If that geometry changes, the construction geometry will recompute. A limitation of Fusion is that it's not possible to create construction geometry that doesn't have a relationship to other entities.
If you use the API to try and create a construction point at an arbitrary point in space, when working in a parametric design, it will fail. I think that's what you're seeing. This limitation is not defined in the documentation. I've updated it to reflect this and it will go out with the next Fusion update.
In case you're wondering what I mean by "capture design history", there's an option when you right-click on the root node that lets you set this for a design.
I found another solution to the larger problem I was working on.
But for future refernce, isn't any arbitrary point in space related to the orgin of the root component, or can't the system default to that? This way everything is related to a geometry that is garunteed to exist, I don't think you can delete the origin of your root? This would allow people alot mroe freedom while workign in this space.