Sie sind auf Seite 1von 2

8/14/13

Related Searches: Text Encryption Software Native POP3 Connector POP Accounts Gmail Filters Txt File

The AutoLisp Ultimate Tutorial - Extreme/Advanced

Back to AutoLisp Tutorial Homepage Back to AutoLisp Homepage Back to JefferyPSanders.com

The AutoLisp Tutorial - Extreme

Well you made it. You've read the Beginners, Intermediate, and Expert's tutorials and now you want to apply your knowledge in real world situations. I believe the best way to approach this is to read through commented code and follow what is going on. It would be even better if you had the programmers thoughts before starting the program. So, we will do that. But what code? This I will leave up to you. If you have read all of the tutorials and still can't get the code to do what you want, click <here> to suggest a program for the Extreme section. I'll start it with a couple of problems I've encountered in the last year or so. Placing vertices along a polyline bulge and figuring the angle of an arc. I know, seems simple. But what happens when your start angle is around 350 degrees and your end angle is around 30 degrees. You can't subtract the end angle from the start angle can you? Placing vertices along a PolyLine Bulge

Figuring the Angle of an Arc

PolyLine Bulge
Have you ever tried to recreate a polyline by drawing lines from vertex to vertex only to find out it doesn't work if you have a polyline bulge? (ARC) Aggravating isn't it. Well, I've found a method to insert vertex points along the polyline bulge area to recreate a bulge effect and get you closer to what you need. I'm looking for this code....

Arc Angle

Have you ever tried to figure the angle of an arc only to be fustrated by the fact the angle cannot be simply subtracted? It's true because an arc's angle is always measured counter clock-wise so you could have a starting angle of 350 degrees and an ending angle of 30 degrees. Can't subtract the end angle from the start angle can you? When it crosses zero, there are problems. (Angle could also be set to clock-wise instead of counter clock-wise) The first method I used was to begin at the starting angle and increment the angle by one until I reached the end angle or I crossed the zero angle. This works but it is a little goofy.
WebCake Ads

The second method I've seen (sent to me by a visitor) was to reset the UCS to the center point with an angle that Trust Rating matched the starting angle. Then simply get the ending angle. Not bad. Not bad at all. Not Yet Rated
jefferypsanders.com The shortest method I've found was to use the built in geometry calculator:

A U T O L I S P
The calculator function we will use is called ANG. The syntax is ANG(apex, endPt1, endPt2). In the illustration above the apex is P1, the first point is P2, and the third point is P3. You can also do this on the command line. CAL and press enter. Then type ang(cur,cur,cur) and press enter. Now pick the three points. To do this in autolisp.....you first need to make sure the calculator is loaded: ( i f( n o tc : c a l ) ( a r x l o a d" g e o m c a l " ) ) Then send your points to the calculator: ( s e t qm y A n g( c a l" a n g ( p 1 , p 2 , p 3 ) " )
www.jefferypsanders.com/autolisp_ext.html 1/2

8/14/13

The AutoLisp Ultimate Tutorial - Extreme/Advanced

This should set variable myAng to 51.9180 Anyone else have a shorter answer? <click> AutoLisp Tutorial Home AutoLisp Home Home All questions/complaints/suggestions should be sent to JefferyPSanders.com Last Updated April 1st, 2013 Copyright 2002-2013 JefferyPSanders.com. All rights reserved.

www.jefferypsanders.com/autolisp_ext.html

2/2

Das könnte Ihnen auch gefallen