Jump to content

LISP Routine to change a 2D Polyline (PL) elevation to match the elevation of a cogo point


Recommended Posts

Posted

Hey everyone,

I'm curious to know if anyone can assist with producing a lisp that will allow a user to click on a cogo point in a drawing, then copy the elevation from the cogo point and then click on a PL and assign the copied elevation from the cogo point to the selected PL.

 

Thanks.

Posted

Can you attached example drawing 

Posted

This is read a cogo point example, you could then assign the elevation property to that value. 

; get X Y Z of a cogo point
; By AlanH

(defun CIV3DPTHT ( / obj oldtext oldlay xyz pt1 ht pt)
  (alert "Pick CIV3D points press ESC or pick nothing to exit")
  (while (setq obj (vlax-ename->vla-object  (car (entsel))))
 ; vl 3d point convert to plain lisp 
  (setq pt1 (vlax-safearray->list (vlax-variant-value (vlax-get-property obj "Location"))))
  (setq ht (rtos (nth 2 pt1) 2 3)) ; Z val
  (setq pt (list (nth 0 pt1)(nth 1 pt1))) ; XY
  (setq oldtext (getvar "textstyle"))
  (setq oldlay (getvar "clayer"))
  (command "Layer" "n" "Pointhts" "c" 1 "Pointhts" "s" "pointhts" "") ; put text on new layer 
  ; 2.5 annotative text  
  (if (setvar "textstyle" "ISO2.5")
      (command "TEXT" pt 0 ht)
      (alert (strcat "The style ISO2.5 annotative does not exists" "\nplease create and run again"))
  ) 
  (setvar "textstyle" oldtext)
  (setvar "clayer" oldlay)
) ; end while 
(princ)
) ; end defun


(CIV3DPTHT)

 

So you want to make a 3dpolyline picking multiple points is that correct ?

Posted

I think you haven't searched for enough solutions but I think this just fits your problem, I tested it and it also works for COGO points.

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...