Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What would cause a Construction Point to fail creation

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
210 Views, 2 Replies

What would cause a Construction Point to fail creation

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)

 

Tags (1)
2 REPLIES 2
Message 2 of 3
ekinsb
in reply to: Anonymous

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.

 

DesignHistory.png

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3
Anonymous
in reply to: ekinsb

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report