reza Posted May 4, 2017 Posted May 4, 2017 I have a 3dpoly from previous my post (Thank Marko_ribar) I like this 3D polyline have a longitudinal profiles Road Plan 4.dwg Quote
BIGAL Posted May 5, 2017 Posted May 5, 2017 You have Civ3d ? Just explode the 3dplines and make a surface using "drawing objects Lines" long section will then come out. The green line is your profile from your dwg, took maybe 5 minutes. Quote
reza Posted May 5, 2017 Author Posted May 5, 2017 dear BIGAL I also agree with you, but I'll try to explain with poor English language In the company that I'm working on it, there are several sections, one of which is the architecture section The personnel in this section will work with the topography have difficulty Not only the topography but also have problems with the "Z" value But locating designed buildings on the topographic maps need to have traced the longitudinal profiles They usually refer to the civil section I suggest to fix this problem long ago, installing a land development or civil3d and I teach it by myself However, this section was not faced with personnel I tried to solve the problem with lisp them is that I got a successful That on the track designed by them on the topography plan I create 3dpolyline and draw longitudinal profiles give the delivery Of course, as long as the problem raised in my previous post I came into Quote
reza Posted May 5, 2017 Author Posted May 5, 2017 I find it : http://www.cadtutor.net/forum/showthread.php?86148-Extract-3d-polyline-station-and-elevation/page2& from (marko_ribar) and mix whit my previous post (solve by marko_ribar) solve my problem App Intersection Curve Final End.lsp Quote
reza Posted May 6, 2017 Author Posted May 6, 2017 (edited) The following two previous posts I have problems if possible guide me in end of the Attachments lisp file (by: Marko_ribar) and after the run script was created program can not continue. Road Plan 3.dwg Create Profile from 3dpoly.lsp Edited May 6, 2017 by reza Quote
BIGAL Posted May 7, 2017 Posted May 7, 2017 Reza do not double post you should have added this to your 1st post. Admin will fix up. I am sure Marko will have a look and respond. Marko I tried code and after "INT" locked up error was ":call back entry". Totally restarted Autocad and at prompt selected some lwplines with a Z value then noticed that selection set was 0 items ? What am I doing wrong ? Quote
reza Posted May 7, 2017 Author Posted May 7, 2017 Hi Dear BIGAL Thank you very much for mentioning right and left. n the next post I'll follow this hint. Quote
reza Posted May 7, 2017 Author Posted May 7, 2017 my dear friends : I met this morning with a problem in using the program in attachment drawing file, Graphic profiles drawn wrong in some places. new block.dwg Quote
reza Posted May 8, 2017 Author Posted May 8, 2017 This error is the general problem. This problem occurs in all topography files Road Plan 4.dwg Quote
marko_ribar Posted May 17, 2017 Posted May 17, 2017 @reza, there is no way you can get Z elevation of vertices of planar LWPOLYLINE that are to be transformed to 3d poly... Instead I suggest that you try to use just intersections with contours... (defun c:flw23pel ;fencelwpoly23dpolyelevations ( / *error* bbucs ucsf osm cec ss1 ss2 i lw pl sss ssl sspl e ) (vl-load-com) (defun *error* ( msg ) (if ucsf (command "_.UCS" "_P") ) (command "_.ZOOM" "_P") (if osm (setvar 'osmode osm) ) (if cec (setvar 'cecolor cec) ) (if msg (prompt msg) ) (princ) ) (defun bbucs ( ss / UCS2WCSMatrix WCS2UCSMatrix n ent minpt maxpt minptlst maxptlst minptbbx minptbby minptbbz minptbb maxptbbx maxptbby maxptbbz maxptbb ) (vl-load-com) ;; Doug C. Broad, Jr. ;; can be used with vla-transformby to ;; transform objects from the UCS to the WCS (defun UCS2WCSMatrix () (vlax-tmatrix (append (mapcar '(lambda (vector origin) (append (trans vector 1 0 t) (list origin)) ) (list '(1 0 0) '(0 1 0) '(0 0 1)) (trans '(0 0 0) 0 1) ) (list '(0 0 0 1)) ) ) ) ;; transform objects from the WCS to the UCS (defun WCS2UCSMatrix () (vlax-tmatrix (append (mapcar '(lambda (vector origin) (append (trans vector 0 1 t) (list origin)) ) (list '(1 0 0) '(0 1 0) '(0 0 1)) (trans '(0 0 0) 1 0) ) (list '(0 0 0 1)) ) ) ) (if ss (progn (repeat (setq n (sslength ss)) (setq ent (ssname ss (setq n (1- n)))) (vla-TransformBy (vlax-ename->vla-object ent) (UCS2WCSMatrix)) (vla-getboundingbox (vlax-ename->vla-object ent) 'minpoint 'maxpoint) (vla-TransformBy (vlax-ename->vla-object ent) (WCS2UCSMatrix)) (setq minpt (vlax-safearray->list minpoint)) (setq maxpt (vlax-safearray->list maxpoint)) (setq minptlst (cons minpt minptlst)) (setq maxptlst (cons maxpt maxptlst)) ) (setq minptbbx (caar (vl-sort minptlst '(lambda (a b) (< (car a) (car b)))))) (setq minptbby (cadar (vl-sort minptlst '(lambda (a b) (< (cadr a) (cadr b)))))) (setq minptbbz (caddar (vl-sort minptlst '(lambda (a b) (< (caddr a) (caddr b)))))) (setq maxptbbx (caar (vl-sort maxptlst '(lambda (a b) (> (car a) (car b)))))) (setq maxptbby (cadar (vl-sort maxptlst '(lambda (a b) (> (cadr a) (cadr b)))))) (setq maxptbbz (caddar (vl-sort maxptlst '(lambda (a b) (> (caddr a) (caddr b)))))) (setq minptbb (list minptbbx minptbby minptbbz)) (setq maxptbb (list maxptbbx maxptbby maxptbbz)) ) ) (list minptbb maxptbb) ) (if (= 0 (getvar 'worlducs)) (progn (command "_.UCS" "_W") (command "_.PLAN" "") (setq ucsf t) ) (command "_.PLAN" "") ) (setq osm (getvar 'osmode)) (setvar 'osmode 0) (setq cec (getvar 'cecolor)) (setvar 'cecolor "3") (prompt "\nSelect OPEN \"STRAIGHT\" LWPOLYLINES that lie in plane parallel to WCS - PROJECTION LWPOLYLINES (NOT ELEVATION)...") (setq ss1 (ssget (list '(0 . "LWPOLYLINE") '(-4 . "<or") '(70 . 0) '(70 . 128) '(-4 . "or>") '(-4 . "<or") '(210 0.0 0.0 1.0) '(210 0.0 0.0 -1.0) '(-4 . "or>") '(-4 . "<not") '(-4 . "<>") '(42 . 0.0) '(-4 . "not>")))) (while (or (not ss1) (vl-every '(lambda ( x ) (not (equal (caddar (bbucs (ssadd x))) (caddr (cadr (bbucs (ssadd x)))) 1e-6))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1)))) ) (prompt "\nEmpty sel.set... Please reselect again...") (setq ss1 (ssget (list '(0 . "LWPOLYLINE") '(-4 . "<or") '(70 . 0) '(70 . 128) '(-4 . "or>") '(-4 . "<or") '(210 0.0 0.0 1.0) '(210 0.0 0.0 -1.0) '(-4 . "or>") '(-4 . "<not") '(-4 . "<>") '(42 . 0.0) '(-4 . "not>")))) ) (prompt "\nSelect LWPOLYLINES that lie in plane parallel to WCS - ELEVATION LWPOLYLINES (NOT PROJECTION)...") (setq ss2 (ssget (list '(0 . "LWPOLYLINE") '(-4 . "<or") '(210 0.0 0.0 1.0) '(210 0.0 0.0 -1.0) '(-4 . "or>")))) (while (not ss2) (prompt "\nEmpty sel.set... Please reselect again...") (setq ss2 (ssget (list '(0 . "LWPOLYLINE") '(-4 . "<or") '(210 0.0 0.0 1.0) '(210 0.0 0.0 -1.0) '(-4 . "or>")))) ) (repeat (setq i (sslength ss1)) (setq lw (ssname ss1 (setq i (1- i)))) (setq pl (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= (car x) 10)) (entget lw)))) (setq sss (ssget "_F" pl (list '(0 . "LWPOLYLINE") '(-4 . "<or") '(210 0.0 0.0 1.0) '(210 0.0 0.0 -1.0) '(-4 . "or>")))) (setq ssl (ssnamex sss)) (setq ssl (vl-remove-if '(lambda ( x ) (eq (cadr x) lw)) ssl)) (setq sspl (mapcar 'cadr (apply 'append (mapcar '(lambda ( x ) (vl-remove-if-not 'listp x)) ssl)))) (setq sspl (vl-sort sspl '(lambda ( a b ) (< (vlax-curve-getparamatpoint lw (vlax-curve-getclosestpointto lw (list (car a) (cadr a) (cdr (assoc 38 (entget lw)))))) (vlax-curve-getparamatpoint lw (vlax-curve-getclosestpointto lw (list (car b) (cadr b) (cdr (assoc 38 (entget lw)))))))))) (command "_.3DPOLY") (foreach p sspl (if (vl-some '(lambda ( x ) (if (vlax-curve-getparamatpoint x (list (car p) (cadr p) (cdr (assoc 38 (entget x))))) (setq e x))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss2)))) (command "_non" (list (car p) (cadr p) (cdr (assoc 38 (entget e))))) ) ) (command "") ) (*error* nil) ) HTH., M.R. 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.