krkec Posted November 23, 2011 Posted November 23, 2011 Hi I want to create a program witch converts 2d cross section to 3dpoint entyties witch are to be placed on cross-section axe on plan. first i create new ucs orgin so vertex point x = 3dpoint xvalue; y = 3dpoint zvalue; now I start programing: ;;a) First I get 2d cross section polyline vertex points from polyline. (vl-load-com) (setq acadObject (vlax-get-acad-object)) (and (setq theobj (car (entsel "\nSelect a Polyline: "))) (setq theobj (vlax-ename->vla-object theobj)) (eq (vlax-get-property theobj 'ObjectName) "AcDbPolyline") (setq thelist (vlax-get theobj 'coordinates)) ;;b) converting point coordinates from wsc to currentucs (setq n 0) (while (/= (nth n thelist) nil) (setq thelist1 (cons (trans (list (nth n thelist) (nth (setq n (1+ n)) thelist)) 0 1 ) ;end trans thelist1 ) ;end cons ) ;end setq (setq n (1+ n)) ) ;end while ) ;;c) Rotateing ucs - determinig crosssecton axe (setq t1 (getpoint "\nOdaberite ishosište koordinatnog sustava")) (setq t2 (getpoint "\nKliknite na točku na pozitivnoj strani")) ;(vl-cmdf -.UCS "w") (setq ms (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object) ) ) ) (setq lin1 (vla-addline ms (vlax-3d-point (trans t1 1 0)) (vlax-3d-point (trans t2 1 0)) ) ) (setq lin (vlax-vla-object->ename lin1)) (princ) ;(command "._UCS" "e" lin) (vl-cmdf "._UCS" "e" lin) (entdel lin) ;;d) drawing points (setq n 0) (while (/= (nth n thelist1) nil) (setq toc (trans (list (nth n thelist1) (nth (setq n (1+ n)) thelist1)) 1 0 ) ;end trans ) ;end setq (vla-addpoint ms (vlax-3d-point (list (nth 0 toc) 0.0 (nth 1 toc))) ) ) (setq toc nil) (setq n (1+ n)) ) ;end while Quote
krkec Posted November 23, 2011 Author Posted November 23, 2011 Sorry, I modify it. Modify your post ... read This Quote
BIGAL Posted November 24, 2011 Posted November 24, 2011 theres a much simpler way to do this if you block the pline rescale it to get back to 1:1 then explode and use rotate3d to stand vertical then xyz are correct in one go. Quote
krkec Posted November 24, 2011 Author Posted November 24, 2011 Yes, but how i do that in Autolisp??? theres a much simpler way to do this if you block the pline rescale it to get back to 1:1 then explode and use rotate3d to stand vertical then xyz are correct in one go. 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.