Jump to content

2D Lisp to 3D...


Nellie

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...