Does anyone know of a lisp routine that will create closed boundaries from a drawing, ie 2D site plan showing streets and pads, offset those boundaries slightly so that each one does not touch and then convert that boundary line to an elevated 3D polyline based off of a piece of plain text showing an elevation, ie. 1250.3
This is probably a very easy lisp routine for someone to write but I have no clue.
Please help.
Solved! Go to Solution.
Solved by tcorey. Go to Solution.
Solved by tcorey. Go to Solution.
Solved by tcorey. Go to Solution.
Hi Max,
Can you post a sketch of what you're trying to accomplish?
Tim
Neil,
I will try your suggestion.
Ultimately I would like to have any linework that crosses in my 2 D file be created into a closed polyline and then converted to a 3D polyline and then elevated to an elevation shown on a piece of text string, oh, and be done globally.
(see attachment for example of before and after)
Thanks
Max,
Not as slick as Neil's method, but here's another possible workflow:
To Trim and Join and Tidy Up Polylines:
Planning & Analysis >> Tools >> Map Edit >> MAPCLEAN
To Offset:
Home Tab >> Create Design >> Feature Line >> Create Feature Line From Stepped Offset
Dave
Dave Stoll
Las Vegas, Nevada
Dave, thanks for the response.
That is the exact way we are doing it now. Each lot elevated one at a time, just trying to find a global solution.
Max, is this what you're looking for? I did not include an offset of the new polylines, but if you really need that, let me know how far to offset and I can add the code in short order.
Tim
;|copyright 2014 Timothy Corey,Delta Engineering Systems Redding, CA Permission is granted to use this code as you see fit, but this code may not be sold or used in any for-sale software. It is the responsibility of the user to verify the accuracy of the program and suitability for your own use. The new polylines are placed on the current layer.|; (defun c:go(/ ls len ctr tobj p1 pl plx) (vl-load-com) (prompt "\nSelect Text Objects: ") (setq ls (ssget) ;ask user to pick selection set of text items len (sslength ls) ;get number of items in set ctr 0) ;set counter to 0 (while (< ctr len) ;while the counter is less than the selection set length (setq tobj (ssname ls ctr)) ;get individual object from set (if (or (= (cdr (assoc 0 (entget tobj))) "MTEXT") (= (cdr (assoc 0 (entget tobj))) "TEXT")) ;if it is a text or mtext object (progn (setq p1 (cdr (assoc 10 (entget tobj))) ;get insertion point of text ) (vl-cmdf "boundary" "A" "B" "E" "I" "N" "" "O" "P" "" p1 "") ;use boundary command to create polyline (setq pl (entlast) plx (entget pl) ) (setq plx (subst (cons 38 (atof (cdr (assoc 1 (entget tobj))))) ;change elevation of polyline to equal text value of text (assoc 38 plx) plx) ) (entmod plx) (entupd pl) );end progn );end if (setq ctr (1+ ctr)) );end while (princ) );end defun
This version asks the user for offset distance.
Tim
;|copyright 2014 Timothy Corey,Delta Engineering Systems Redding, CA Permission is granted to use this code as you see fit, but this code may not be sold or used in any for-sale software. It is the responsibility of the user to verify the accuracy of the program and suitability for your own use. The new polylines are placed on the current layer.|; (defun c:go(/ ls len ctr tobj p1 pl plx) (vl-load-com) (prompt "\nSelect Text Objects: ") (setq ls (ssget) ;ask user to pick selection set of text items len (sslength ls) ;get number of items in set ctr 0) ;set counter to 0 (setq OffDis (getreal "\nEnter offset distance: ")) (while (< ctr len) ;while the counter is less than the selection set length (setq tobj (ssname ls ctr)) ;get individual object from set (if (or (= (cdr (assoc 0 (entget tobj))) "MTEXT") (= (cdr (assoc 0 (entget tobj))) "TEXT")) ;if it is a text or mtext object (progn (setq p1 (cdr (assoc 10 (entget tobj))) ;get insertion point of text ) (vl-cmdf "boundary" "A" "B" "E" "I" "N" "" "O" "P" "" p1 "") ;use boundary command to create polyline (setq pl (entlast) plx (entget pl) ) (setq plx (subst (cons 38 (atof (cdr (assoc 1 (entget tobj))))) ;change elevation of polyline to equal text value of text (assoc 38 plx) plx) ) (entmod plx) (entupd pl) (vl-cmdf "Offset" offdis pl p1 "E") (vl-cmdf "Erase" pl "") );end progn );end if (setq ctr (1+ ctr)) );end while (princ) );end defun
Tim,
Thanks so much for your help with this, I appreciate the time you spent on this.
And thanks to eveyone else that gave suggestions.
Great lisp but how does it determine the side to offset? I tried with some test polylines and the offset went to the inside rather than the outside of the closed polylines.
neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Thanks for the reply Tim
I get data that typically will show a house plot outline and a finished floor level within the plot and I need to create a typical 2.5m offset (for scaffolding etc) outside the plot boundary and also adjust the levels to earthworks level so it would be great if you could modify the lisp to offset outside and I can use other techniques to adjust the levels.
Thanks
neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Neil, would you like to post a drawing or send me one: tcorey at shasta dot com?
neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Neil, here is a version that asks for offset distance and FFL Offset, offsets to the outside and drops the offset pline by the FFL amount. If you type 3 for the FFL adjustment, the new pline will drop 3 units. No need to put in a minus.
Tim
;|copyright 2014 Timothy Corey,Delta Engineering Systems Redding, CA Permission is granted to use this code as you see fit, but this code may not be sold or used in any for-sale software. It is the responsibility of the user to verify the accuracy of the program and suitability for your own use. The new polylines are placed on the current layer.|; (defun c:go(/ ls len ctr tobj p1 pl plx) (vl-load-com) (prompt "\nSelect Text Objects: ") (setq ls (ssget) ;ask user to pick selection set of text items len (sslength ls) ;get number of items in set ctr 0) ;set counter to 0 (setq OffDis (getreal "\nEnter offset distance: ")) (setq ffladj (getreal "\nEnter FFL Adjustment: ")) (while (< ctr len) ;while the counter is less than the selection set length (setq tobj (ssname ls ctr)) ;get individual object from set (if (or (= (cdr (assoc 0 (entget tobj))) "MTEXT") (= (cdr (assoc 0 (entget tobj))) "TEXT")) ;if it is a text or mtext object (progn (setq p1 (cdr (assoc 10 (entget tobj))) ;get insertion point of text ) (vl-cmdf "boundary" "A" "B" "E" "I" "N" "" "O" "P" "" p1 "") ;use boundary command to create polyline (setq pl (entlast) plx (entget pl) ) (setq plx (subst (cons 38 (atof (cdr (assoc 1 (entget tobj))))) ;change elevation of polyline to equal text value of text (assoc 38 plx) plx) ) (entmod plx) (entupd pl) (setq p2 (polar p1 0 30)) (vl-cmdf "Offset" offdis pl p2 "E") (setq pl2 (entlast) pl2x (entget pl2)) (setq pl2x (subst (cons 38 (- (atof (cdr (assoc 1 (entget tobj)))) ffladj)) ;change elevation of polyline to equal text value of text - FFL Adjustment (assoc 38 pl2x) pl2x) ) (entmod pl2x) (entupd pl2) (vl-cmdf "Erase" pl "") );end progn );end if (setq ctr (1+ ctr)) );end while (princ) );end defun
neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Can't find what you're looking for? Ask the community or share your knowledge.