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: 

Question regarding the origin point of a construction plane created with Plane.createUsingDirections and setting Bounding box

1 REPLY 1
SOLVED
Reply
Message 1 of 2
charles-olivier.lamarche
331 Views, 1 Reply

Question regarding the origin point of a construction plane created with Plane.createUsingDirections and setting Bounding box

Hi,

As of now, in my code base, I am creating construction planes with the planeInput->setByDistanceOnPath method which allows me to get the construction plane centered on the origin, and corresponds to the starting point of the line entity passed as the first argument of the method. This greatly facilitates my next step where I set the bounding box of the construction plane like a rectangle. The first file attachment illustrates the result. (Plane_setByDistanceOnPath.png)

 

Now, I would like to know if there is a way to obtain the same result (construction plane centered on origin) with another method I am trying that would eliminate the need to create a sketch line. This method is : 

 

 

planeInput = planes.createInput()

planeInput.targetBaseOrFormFeature = baseFeat

origin = adsk.core.Point3D.create(0, 0, 0)
xAxis = adsk.core.Vector3D.create(1, 0, 0)
yAxis = adsk.core.Vector3D.create(0, 1, 0)

plane_test = adsk.core.Plane.createUsingDirections(origin, xAxis, yAxis)

planeInput.setByPlane(plane_test)
planes.add(planeInput)

 

 

The problem is I am not getting the construction plane centered on origin point. Instead, it is close to a corner,

like in the second image (Plane_createUsingDirections.png). It seems to be affecting the way the bounding box is set and it's difficult to understand what's going on.

 

I am unable to replicate a Plane accurately that comes from another software with it's origin, normal, Xdirection, length and height. Any pointers toward another solution are welcome

 

Thank you,

Charles

1 REPLY 1
Message 2 of 2

Hi @charles-olivier.lamarche ,

 

The construction planes you create based on one of the planes of the model's origin (XY, YZ, XZ) always have the origin in the center point ("O") of the 3D space plus the displacement from the plane.

If the construction plane was create based on any other surface, the origin is the center of that surface.

 

In the first case, that's is why you get the origin in a corner, while in the second case, it is at the center of the projected surface.

 

To solve your problem, always use construction planes that are derived from any surface, other than the model's origin.

 

Hope this could solve your question, if I understood it right.

 

Regards,

Jorge

 

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