SetOrientation Method

Thanks for the quick replies Richard!

I’m not sure if you wish me to place requests for enhancement here or in the suggestions forum, but while I’m at it, may I suggest methods for:

frame.getorientation, frame.setorientation
as well as the
obj.shift operation?

Thanks!

Drew

I’m trying to learn how to properly use the frame.SetOrientation method in the scripting language. I’ve researched the topics of camera placement and up vectors, however, I can’t seem to figure out how to get a frame to change its orientation in an expected way.

For instance, I have a frame which I can type in the values 90 for x, 0 for y and 0 for z in the frame orientation parameters and the part is oriented correctly. However, if I try to do this programatically by issuing this statement:
frame.SetOrientation Nothing, 0, 90,0,0,0,1,0 I do not get the same result. Instead I get a 90 value in the y parameter for the frame orientation.

How do I properly use the SetOrientation method?

Thanks!

Drew

Hi,

Orientation is not in degrees. Orientation is actually the Direction and Up vectors for the object. Direction is a vector that defines the direction the object is andquot;lookingandquot;. For example with an airplane the direction would be the direction the airplane was travelling. This doesn’t fully describe its orientation though since it doesn’t say anything about whether the plane is flying upside down, rightside up, on its side or somewhere in between. That is what the Up vector is used for. Unfortunately there is no real way to andquot;manuallyandquot; select values for these since they don’t mesh with how we think about things. Direction 0,0,1 and Up 0,1,0 describe an object pointed along the Z axis with up pointed towards the sky. You’ll need to know some vector math (rotating vectors) do do anything more.

BTW This really belongs in the Pro scripting forum. If you are a registered user of 3DC Pro let me know and I will provide you with Pro forum access.

Richard

I’ve provided you with Pro Access.

As for setting orientation, you’ll need do a little bit of math research. There aren’t any methods available yet to do this for you.

Richard

After thinking about the issue for a moment, is there (or can there be) a scripting method to set the Frame Orientation parameters found on the Frame Properties screen?

If I adjust those parameters, 3DC does exactly what I want, I just don’t have a way to set those parameters from scripts.

Drew

Richard,

I am a registered user of the Pro product and would like access to the Scripting forum please.

Is there anyway (via scripting) to do what I wish? andnbsp;I guess I’ll have to purchase a 3D textbook to figure this one out!

Drew

Yes, please post your requests at the andquot;suggestionsandquot; forum.

To be honest, I don’t think I’ll get to those any time soon unless you can say to me:

andquot;I am doing something really coolandquot; (and explain it) andquot;doing this will benefit 3DC this wayandquot; (explain this). andquot;and it will save you doing thisandquot; (explain)

Or at least some subset of it. The reason I say this is not that I don’t want to do this. It is just that my time is extremely limited and unless it is going to benefit a number of people it won’t likely get done.

Richard

You must be logged in to reply in this thread.

7 posts