pyou Posted 23 hours ago Posted 23 hours ago (edited) Hi all I have many Closed 3dpolyline Triangles with 4 vertices each. Would it be possible with the help of lisp command to track all triangles and remove duplicates, please? Its the first and second vertices with same position. Thank you Edited 23 hours ago by pyou Quote
pyou Posted 4 hours ago Author Posted 4 hours ago (edited) 9 hours ago, Lee Mac said: OVERKILL should remove the duplicate vertices. not in this case , unless i am doing something wrong. I have attached example dwg. Basically i had 3DFaces as Triangles and converted them using lisp into 3dpolyline Triangles, but it creates 4 Vertices for each Triangle, another lisp which supposed to create contours over triangles refusing to do so and say 3dpolylines are not closed polylines. Long story short, I am looking for a lisp which could create Contours at desired interval over 3DFaces. For example at 0.2m 1.0m interval and label them up along at specific distance. sample.dwg Edited 4 hours ago by pyou Quote
Tsuky Posted 1 hour ago Posted 1 hour ago Hi, With your drawing, this code will correct the polylines. To be adapted if used in another drawing (ssget filter) (vl-load-com) (defun c:Correct3DPL ( / ss AcDoc Space nb n ename obj l_pt lay new_obj) (setq ss (ssget "_X" '((0 . "POLYLINE") (67 . 0) (8 . "CTL_PNT") (66 . 1) (70 . 9)))) (cond (ss (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) nb 0 ) (repeat (setq n (sslength ss)) (setq ename (ssname ss (setq n (1- n))) obj (vlax-ename->vla-object ename) l_pt (vlax-get obj 'Coordinates) lay (vlax-get obj 'Layer) ) (cond ((eq (length l_pt) 12) (vla-delete obj) (setq new_obj (vlax-invoke Space 'Add3dPoly (cdddr l_pt))) (vla-put-Closed new_obj :vlax-true) (vla-put-Layer new_obj lay) (setq nb (1+ nb)) ) ) ) (princ (strcat "\n" (itoa nb) " polylines corrected.")) ) ) (prin1) ) 1 Quote
pyou Posted 1 hour ago Author Posted 1 hour ago 16 minutes ago, Tsuky said: Hi, With your drawing, this code will correct the polylines. To be adapted if used in another drawing (ssget filter) (vl-load-com) (defun c:Correct3DPL ( / ss AcDoc Space nb n ename obj l_pt lay new_obj) (setq ss (ssget "_X" '((0 . "POLYLINE") (67 . 0) (8 . "CTL_PNT") (66 . 1) (70 . 9)))) (cond (ss (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) nb 0 ) (repeat (setq n (sslength ss)) (setq ename (ssname ss (setq n (1- n))) obj (vlax-ename->vla-object ename) l_pt (vlax-get obj 'Coordinates) lay (vlax-get obj 'Layer) ) (cond ((eq (length l_pt) 12) (vla-delete obj) (setq new_obj (vlax-invoke Space 'Add3dPoly (cdddr l_pt))) (vla-put-Closed new_obj :vlax-true) (vla-put-Layer new_obj lay) (setq nb (1+ nb)) ) ) ) (princ (strcat "\n" (itoa nb) " polylines corrected.")) ) ) (prin1) ) Thank you Tsuky, works exactly as i needed. Quote
BIGAL Posted 29 minutes ago Posted 29 minutes ago Not sure if the lisp by YMG will read 3dfaces. CIV3d will do it same with other civil packages like Civil Site Design.TriangV0.6.7.LSP 1 Quote
pyou Posted 11 minutes ago Author Posted 11 minutes ago 17 minutes ago, BIGAL said: Not sure if the lisp by YMG will read 3dfaces. CIV3d will do it same with other civil packages like Civil Site Design.TriangV0.6.7.LSP Nice one Bigal, Thank you! 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.