Nellie Posted October 24, 2008 Share Posted October 24, 2008 Can someone please explain how i can change the attached lisp from giving the value of X and Y plain to just giving the value of the Z plain? Thanks in advance. lemar.lsp Quote Link to comment Share on other sites More sharing options...
ASMI Posted October 24, 2008 Share Posted October 24, 2008 Can someone please explain how i can change the attached lisp from giving the value of X and Y plain to just giving the value of the Z plain? Look for blue lisp function. New name is LEMAZ. (defun c:lemaz(/ sCol bCol nStl nBlk cBlk nAtr ln1 ln2 cAtr) (vl-load-com) (setq aDoc(vla-get-ActiveDocument (vlax-get-acad-object)) sCol(vla-get-TextStyles aDoc) bCol(vla-get-Blocks aDoc) ); end setq (if(vl-catch-all-error-p(vl-catch-all-apply 'vla-Item (list sCol "Simplex"))) (progn (setq nStl(vla-Add sCol "Simplex")) (vla-put-FontFile nStl "simplex.shx") ); end progn ); end if (if(vl-catch-all-error-p(vl-catch-all-apply 'vla-Item (list bCol "Level Marker"))) (progn (setq nBlk(vla-Add bCol (vlax-3D-point '(0 0 0)) "Level Marker")) (setq nAtr(vla-AddAttribute nBlk 0.18 acAttributeModePreset "" (vlax-3D-point '(0 0 0)) "LEVEL" "X")) (vla-put-Alignment nAtr acAlignmentBottomCenter) (vla-put-StyleName nAtr "Simplex") (vla-put-TextAlignmentPoint nAtr (vlax-3D-point '(0.0 0.1 0.0))) (setq ln1(vla-AddLine nBlk(vlax-3D-Point '(-0.09 0.0 0.0)) (vlax-3D-Point '(0.09 0.0 0.0))) ln2(vla-AddLine nBlk(vlax-3D-Point '(0.0 -0.09 0.0)) (vlax-3D-Point '(0.0 0.09 0.0)))) (mapcar 'vla-put-Layer '(nAtr ln1 ln2) '("0" "0" "0")) ); end progn ); end if (princ "\nPlace level marker or Right Click to Quit> ") (while(setq cPt(getpoint)) (setq cBlk(vla-InsertBlock(vla-get-ModelSpace aDoc) (vlax-3D-Point cPt)"Level Marker" 1.0 1.0 1.0 0.0) cAtr(car(vlax-safearray->list (vlax-variant-value(vla-GetAttributes cBlk))))) (vla-put-TextString cAtr(rtos([color="Blue"]last[/color] cPt)2 2)) ); end while (princ) ); end of c:lemaz Quote Link to comment Share on other sites More sharing options...
Nellie Posted October 29, 2008 Author Share Posted October 29, 2008 Thanks very much ASMI thats going to save me loads of time. Sorry for the delay. Quote Link to comment Share on other sites More sharing options...
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.