ibach Posted December 23, 2012 Posted December 23, 2012 seems like you are trying to draw 3d dimension line without changing UCS... if so ... great idea. I d love to see it work Quote
popey3 Posted December 26, 2012 Author Posted December 26, 2012 hey! i made the code i wanted to get with this thread and would like to present it for you guys: (princ " frame;;Draw the frame for the entire drawing") (defun c:frame ( / corner1 corner3 F1 Frame0 ) (setq corner1 (list -15.5 15 0)) (setq corner3 (list 5.5 -14 0)) (command "rectangle" corner1 corner3) (setq F1 (entlast)) (setq Frame0(vlax-ename->vla-object F1)) ) ;;******************************************************************************************** ;;Define the coordinates of point A and draw it (princ " drawA;;Define the coordinates of point A and draw it") (defun c:drawA ( / Axx Ayy Azz) (setq pointA (getpoint "\nSpecify Point A: "));;Asks user to specify point (setq Axx (nth 0 PointA)) ;;selects the 1st variable in the list pointA (setq Ayy (nth 1 PointA)) ;;selects the 2nd variable in the list pointA (setq Azz (nth 2 PointA)) ;;selects the 3rd variable in the list pointA (setq A1 (list (* Axx -1) (* -1 Ayy) 0.0)) ;;sets coords for p on plane (x-y) (setq A2 (list (* Axx -1) Azz 0.0)) ;;sets coords for p on plane (x-z) (command "insert" "tA1" A1 1 1 0) ;;inserts the mark for P on plane (x-y) (command "insert" "tA2" A2 1 1 0) ;;inserts the mark for P on plane (x-z) ) ;;******************************************************************************************** ;;Define the coordinates of point B (princ " DrawB;;Define the coordinates of point B") (defun c:DrawB ( / Bxx Byy Bzz) (setq pointB (getpoint "\nSpecify Point B: "));;Asks user to specify point (setq Bxx (nth 0 PointB)) ;;selects the 1st variable in the list pointB (setq Byy (nth 1 PointB)) ;;selects the 2nd variable in the list pointB (setq Bzz (nth 2 PointB)) ;;selects the 3rd variable in the list pointB (setq B1 (list (* Bxx -1) (* -1 Byy) 0.0)) ;;sets coords for T on plane (x-y) (setq B2 (list (* Bxx -1) Bzz 0.0)) ;;sets coords for T on plane (x-z) (command "insert" "tb1" B1 1 1 0) ;;inserts the mark for T on plane (x-y) (command "insert" "tb2" B2 1 1 0) ;;inserts the mark for T on plane (x-z) ) ;;******************************************************************************************** ;;draw the line on (X-Y) (princ " funkp1;;draw the line on (X-Y)") (defun c:funkp1 ( / ax ay az bx by bz) (setq ax (car A1)) (setq ay (cadr A1)) (setq az (cadr A2)) (setq bx (car B1)) (setq by (cadr B1)) (setq bz (cadr B2)) (setq Dy1 (- by ay)) (setq Dx1 (- bx ax)) (setq K1 (/ Dy1 Dx1)) (setq N1 (- ay (* ax K1))) (setq edgeX1 -13) (setq edgeY1 (+ N1 (* K1 edgex1))) (setq edge1 (list edgex1 edgey1 0.0)) (setq edgeX2 3) (setq edgeY2 (+ N1 (* K1 edgeX2))) (setq edge2 (list edgex2 edgey2 0.0)) (entmake (list (cons 0 "LINE")(cons 10 edge1)(cons 11 edge2))) ) ;;******************************************************************************************** ;;draw the line on (X-Z) (princ " funkp2;;draw the line on (X-Z)") (defun c:funkp2 ( / ax ay az bx by bz) (setq ax (car A2)) (setq ay (cadr A2)) (setq az (cadr A2)) (setq bx (car B2)) (setq by (cadr B2)) (setq bz (cadr B2)) (setq Dy2 (- by ay)) (setq Dx2 (- bx ax)) (setq K2 (/ Dy2 Dx2)) (setq N2 (- ay (* ax K2))) (setq edgeX3 -13) (setq edgeY3 (+ N2 (* K2 edgex3))) (setq edge3 (list edgex3 edgey3 0.0)) (setq edgeX4 3) (setq edgeY4 (+ N2 (* K2 edgeX4))) (setq edge4 (list edgex4 edgey4 0.0)) (entmake (list (cons 0 "LINE")(cons 10 edge3)(cons 11 edge4))) ) i have some more ideas that i want to put into it, but i'm content with this for now. The new stuff will include mostly object snapping from these points, so i will read up on referencing objects before continuing. thanks for the help! 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.