ionw Posted November 6, 2007 Share Posted November 6, 2007 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 Quote Link to comment
Pat Stanford Posted November 6, 2007 Share Posted November 6, 2007 Ion, What is it you are trying to get the rotation of? I would think that you want the rotation of the viewport, then rotate the marker to the inverse of that angle. Is that correct? If so, I think I have some code that will get a handle to the viewport from inside the annotation. Let me know, Pat Quote Link to comment
ionw Posted November 6, 2007 Author Share Posted November 6, 2007 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 Quote Link to comment
Pat Stanford Posted November 6, 2007 Share Posted November 6, 2007 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 Quote Link to comment
ionw Posted November 7, 2007 Author Share Posted November 7, 2007 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 Quote Link to comment
ionw Posted November 12, 2007 Author Share Posted November 12, 2007 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); Quote Link to comment
IanH Posted November 30, 2007 Share Posted November 30, 2007 Im looking to make a north point orientation aware - where the 'N' always keeps correctly orientated, irrespective of the orientation of the viewport. Hopefully, your information will assist me. Thankyou. Quote Link to comment
Recommended Posts
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.