Need help determining planar sketch coordinate system orientation

Need help determining planar sketch coordinate system orientation

dhaverstick
Advocate Advocate
278 Views
2 Replies
Message 1 of 3

Need help determining planar sketch coordinate system orientation

dhaverstick
Advocate
Advocate

I have an Inventor app where I am poking holes in a cylindrical shell. Driven by user inputs, a planar sketch is created and geometry is drawn in that sketch. The sketch geometry is used as a profile to cut a hole in the cylindrical shell using the extrusion method. Ideally, I would like all these planar sketches to have a coordinate system where X is the horizontal axis and the positive direction is to the right. Y is the vertical axis and the positive direction is up. That way I know how to correctly constrain my sketch geometry every time.

 

Unfortunately, Inventor has its own ideas and, depending on angles entered, planes referenced, etc., I never know how that planar sketch coordinate system is going to turn out. A simple example of what I'm talking about is when you put a horizontal constraint on a line and the line turns vertical in your view due to the sketch coordinate system being different that what you expected.

 

Is there a way to know how the sketch coordinate system is oriented using code? Or, even better, is there a way to change it to be the way I want it?

 

Darren Haverstick

Paul Mueller Company

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

Michael.Navara
Advisor
Advisor

You can control sketch orientation using AxisEntity property

But you can use hole definition by point and direction instead of sketch definition. Isn't it better solution?

0 Likes
Message 3 of 3

dhaverstick
Advocate
Advocate
Accepted solution

The pictures below better illustrate what I'm talking about. I need this sketch ellipse to either have its major axis along the horizontal axis, or at some specified angle from the horizontal axis.  The photo below shows a sketch that has the correct orientation.

CorrectOrientation.png

The photo below shows a sketch made with the same code. This sketch has an undesirable orientation.

IncorrectOrientation.png

 

After I posted my initial inquiry, I did a little more investigation and found that the planar sketch object has a boolean property, AxisIsX. If I understand the property correctly, if AxisIsX is False then the Y axis is horizontal and the X axis is vertical. If AxisIsX is True then the Y axis is vertical and the X axis is horizontal. I changed my code to check the value of this property. If it has a False value then I set it to True. With the little testing I've done, this seems to fix my issue. The bottom screen shot was created with my unchanged code. The top screen shot was created with my code changing the AxisIsX value from False to True.

 

Further testing will determine if this is the fix I need or not.

 

Darren

0 Likes