Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

contour cross section lisp please

5 REPLIES 5
Reply
Message 1 of 6
tanerpro
5726 Views, 5 Replies

contour cross section lisp please

Anyone has a lisp for contour cross sectioning?
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: tanerpro

If you are wanting to pick elevations from contours (presumably represented by autocad entities), here is a very
simple tool that might help. It turns on the near snap, and requires you to "eyeball" a straight path. It will
build a polyline cross section starting at (0 0) with no vertical exageration (since near onsap will be on, you
might want to make sure that part of the drawing is free of entities). A commented version is attached.

;XSECT
(defun c:xsect ()
(setq os (getvar "osmode"))(setvar "osmode" 512)
(setq total_distance 0.0
p (getpoint "\nPick first point on an entity [near snap on]")
lastpoint p
)
(command "pline" (list 0.0 (caddr p)))
(while (setq p (getpoint lastpoint "\nPick next point on an entity [near snap on], or hit Enter to stop"))
(setq total_distance
(+ total_distance
(distance (list (car lastpoint)(cadr lastpoint))(list (car p)(cadr p))))
)
(command (list total_distance (caddr p)))
(setq lastpoint p)
)
(command "")
(setvar "osmode" os)
)
Message 3 of 6
tanerpro
in reply to: tanerpro

thanks,
but i have a section line passing through contours, and i want to find the cross section passing from this line.
Message 4 of 6
Anonymous
in reply to: tanerpro

1. Are the contours represented by polylines (lwpolylines), splines, or some heterogenous collection of entities?
2. Do you need this for a single section?
3. How many contours does the the section line pass thru (10 or 1000)?
4. What kind of accuracy is acceptable?
Message 5 of 6
tanerpro
in reply to: tanerpro

hi
1- Sometimes lwpolylines, sometimes 3dpolylines
2- there may be more than one sections needed, but the user will select only one line per section
3- it depends, 1, 5 , 10, 25
4- 0.00

thanks
Message 6 of 6
Anonymous
in reply to: tanerpro

The attached file may be of some use. It expects the section line to be a simple line entity. It can handle either 3dpolylines or lwpolylines, but it assumes that all vertices of a 3dpolyline have the same elevation, which it obtains from the first vertex. Also, it is not equipped to handle splined polylines, and will yield inaccurate results if it encounters them. I did not include a vertical exageration factor, but that would be easy to add.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost