Jump to content
Developer Wiki and Function Reference Links ×

Finding rotation of PIO while in Viewport Annotations


ionw

Recommended Posts

I have written an interior elevation marker that keeps the text level, regardless of the rotation of the PIO.

The nuts and bolts of the mechanism is this:

LHan:=ActLayer;

OHan:=FSObject(LHan);

rot:=GetSymRot(OHan);

In any design or sheet layer this works perfectly.

It fails to orient the text in viewport annotations.

It seems it is failing to get a handle to the layer, hence a failure to get a handle to the object, and thus cannot tell me the rotation of the object. Is there a different way to get the rotation of my PIO to counter rotate my symbol?

Thanks for your time and attention,

ion

Link to comment

I am getting the rotation of the currently being created PIO in relation to the coordinate system. It is irrespective of the viewport rotation, or layer rotation in the instance of VW 2008.

say for example a user creates a PIO, it is rotated 90 degrees. the code snippet I included above returns to me, 90 which I use to counter rotate the text, so it is always level to the sheet. If I didn't the text would be created at 0 rotation within the PIO space, and appear on the sheet to be rotated 90 degrees.

I hope that makes more sense. Thanks for your input,

ion

Link to comment

OK, I am working from memory here. If we don't get this soon, I will dig deeper into my archives tonight or tomorrow.

An object in an annotation is actually a group nested two level deep (the Viewport is essentially a group that contains a crop group and an annotation group). Therefore, when you are getting the rotation of the FSActLayer, you are probably getting the rotation of the viewport. Try rotating the viewport to see.

As you stated, you need another way to get the handle to your PIO.

From the VectorScript Mail List:

Subject: Re: Object angle

From: listmgr@VECTOREXPRESS.COM

Date: June 11, 2005 9:42:34 AM PDT

To: VWSDK-L@LISTS.NEMETSCHEK.NET

Reply-To: VWSDK-L@LISTS.NEMETSCHEK.NET

Hi Dirk,

Maybe try:

GetSymRot(gParmhan);

then draw the object(s) that needs to be counter-rotated and then

HRotate(LNewObj, 0, 0, - gRot);

hth,

Frank Brault

On Jun 11, 2005, at 12:17 PM, Dirk Baarendse wrote:

Hi all,

How can I get the angle of a line PIO within the VectorScript PIO code?

I?m trying to create a reference PIO where a reference line should point to a certain location (1st click point) and that the referencing information is drawn horizontally at the end of the reference line (2nd click or dragged point).

The 1st object is what?s created now and the 2nd object is how I would like it to be.

So it should behave like the Callout Object.

Thanks,

Dirk

Link to comment

It isn't picking up rotation at all from the viewport, I tossed in a message to tell me the rotation, and it doesn't matter if the viewport is rotated or no, I get zero as a rotation.

I am essentially doing the steps outlined in the email, so there isn't any help there.

Debugging a bit, it looks like I am getting handle to the sheet layer, and thus getting a handle to the last drawn/created object on the sheet layer. But GetSymRot(Han); is not returning the rotation of a viewport. In the end that doesn't matter anyway since it isn't the viewport rotation I want.

This is going to be a sticky one.

thanks for your input,

ion

Link to comment

The solution is to get the handle to the object using a different call. Where before I was basing the call for a handle on the last created object on a layer, polling the object in question was a better solution, and works just wonderfully.

Ion

VAR

check :BOOLEAN;

OHan, Rhan, WHan : HANDLE;

OName :STRING;

check := GetCustomObjectInfo(OName,OHan,RHan,WHan);

Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...