ConstructionPlaneInput.setByTwoEdges issue

ConstructionPlaneInput.setByTwoEdges issue

jean-marc_langlois
Contributor Contributor
740 Views
2 Replies
Message 1 of 3

ConstructionPlaneInput.setByTwoEdges issue

jean-marc_langlois
Contributor
Contributor

Hi all,

I've been struggling for quite some time now to try to create a sketch whose orientation is neither the XY, XZ or YZ plane and whose origin is not 0,0,0 either.

I have been able to achieve this by "pushing" a new transform in the sketch I am creating (the transform was changed using Matrix3D.setWithCoordinateSystem ), but that only seems to work (per the API documentation and from my own tests) for non-parametric designs.

In parameteric designs, I had to rely on construction planes to *** almost *** get what I wanted.

Here is what I did:

1) Created a line in the new sketch's X axis direction in the XY construction plane
2) Created a line in the new sketch's Y axis direction in the XY construction plane
3) Created a construction plane from those 2 lines, using the ConstructionPlaneInput.setByTwoEdges method

Once this is done, I end up with a sketch that *** seems *** to be oriented properly.

But when adding to that new sketch a line that goes from (0,0,0) to (10,0,0) , the line does not up where I expected it. (see image in attached zip)

So what I'd like to find is how the "setByTwoEdges" method determines the X, Y and Z axes of the resulting construction plane from the 2 edges it receives for its creation ?

Attached in the zip there also is a python sample that reproduces the situation.

Thanks in advance for any comment / advice

Regards

Jean-Marc Langlois

 

0 Likes
Accepted solutions (1)
741 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

There are "magic" internal algorithms that determine the orientation of construction planes and sketches that are probably better not to try and figure out because it's likely to lead to frustration.

 

To get the result you're looking for, I would recommend using a base feature and creating your sketch there. A base feature is like a non-parametric island within a parametric part. The sketch that is owned by the base feature can be reorientated and repositioned by setting its transformation property so you can do anything you want with it. 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3

jean-marc_langlois
Contributor
Contributor
Thanks Brian - that works nicely.
0 Likes