priyanka_mehta Posted July 9, 2010 Posted July 9, 2010 Hi all, My code is almost done but i am stuck at the end. I am supposed to show directions and have been provided with the value of u and v. Using atan(v/u) i get the value of theta. But the problem that i guess is that by default the unit is set to East anticlockwise. So if i have to plot 83° it appears like 7°. Because it shows 0 in the East.If i change units to north clockwise, it doesn't makes a difference only if i plot in manually but no difference if i try to plot it via VBA. Is there a way or some setting so that I can make 0° North clockwise as default Please find the attached image. Thanks a lot Priyanka Quote
MSasu Posted July 9, 2010 Posted July 9, 2010 Is there a way or some setting so that I can make 0° North clockwise as default I think that the system variables ANGBASE (set to 90) and ANGDIR (set to 1) are what you are looking for. Please don't forget that those are saved in drawing. Regards, Quote
priyanka_mehta Posted July 9, 2010 Author Posted July 9, 2010 It didn't help . I tried making angbase 0 but its still the same. Sorry I forgot to paste the code in my previous thread. Is there something wrong with the code ?! Dim Line As AcadLine Dim r As Double Dim theta As Double Pnt = ThisDrawing.Utility.GetPoint(, "select point") InsertionPoint(0) = Pnt(0) InsertionPoint(1) = Pnt(1) InsertionPoint(2) = 0 r = 2 'Suppose r = 2 and theta = 0 radians theta = 0 polarpnt = ThisDrawing.Utility.PolarPoint(InsertionPoint, theta, r) Set Line = ThisDrawing.ModelSpace.AddLine(InsertionPoint, polarpnt) Dim pText As AcadText degree = (theta * 180) / 3.14 Set pText = ThisDrawing.ModelSpace.AddText(degree, (Line.EndPoint), 0.3) Quote
MSasu Posted July 9, 2010 Posted July 9, 2010 Since you want North to be the 0 angle should set ANGBASE to 90, not to 0. I think the below example is what you need to use: ThisDrawing.SetVariable "ANGBASE", 90 ThisDrawing.SetVariable "ANGDIR", 1 PS. Please take care that there is a separate sub-forum for VBA/.Net solutions. Regards, Quote
priyanka_mehta Posted July 9, 2010 Author Posted July 9, 2010 Still no luck.. It is still creating line at 90° north when theta = 0 even after including the above code. Do i still need to add more lines of code to it. When i manually change the drawing unit angles and manually create a line with command like @10 Quote
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.