Create COGO POINT from Circle using Lisp

Create COGO POINT from Circle using Lisp

crepinmoussavou
Explorer Explorer
2,097 Views
5 Replies
Message 1 of 6

Create COGO POINT from Circle using Lisp

crepinmoussavou
Explorer
Explorer

Hello,

 

I habe a lot of circles in my Civil drawing that I wonna transform into Cogo Points with defined name using LISP. The name of each Cogo Point should be x/y (the lokal coordinates of the transformed circle).

Can someone help me please? Thanks

0 Likes
Accepted solutions (1)
2,098 Views
5 Replies
Replies (5)
Message 2 of 6

hosneyalaa
Advisor
Advisor

Hi 

Use -DATAEXTRACTION (Command)

Extract the coordinates of the center for each circle to a text file

And put it in Civil 3D drawing

It is description Make x/y appear.

0 Likes
Message 3 of 6

hosneyalaa
Advisor
Advisor
Accepted solution

hi

try

 

 

(defun c:TESTCIRCLE (/ C3D C3DDOC ENAME I OCOGO PL PLN PNTNUMS POINTS POIT POITXY POITZ SS)
  

  (vl-load-com)
(setvar "CMDECHO" 0)
(command "-osnap" "off")


  ;; Jeff_M
    (defun getC3D	()
    (vl-load-com)
    (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
		      (if vlax-user-product-key
			(vlax-user-product-key)
			(vlax-product-key)
		      )
	      )
	  C3D (vl-registry-read C3D "Release")
	  C3D (substr
		C3D
		1
		(vl-string-search
		  "."
		  C3D
		  (+ (vl-string-search "." C3D) 1)
		)
	      )
	  C3D (vla-getinterfaceobject
		(vlax-get-acad-object)
		(strcat "AeccXUiLand.AeccApplication." C3D)
	      )
    )
    (setq C3Ddoc (vla-get-activedocument C3D))
  )
  
  (princ "\nSelect CIRCLEs: ")

  (if(setq ss (ssget '((0 . "CIRCLE"))))
     (PROGN
        (setq i -1)
      (getC3D)
      (setq points (vlax-get C3Ddoc 'points))
      (while (setq ename (ssname ss (setq i (1+ i))))
	(PROGN
	(setq pl (vlax-ename->vla-object ename))
	(setq plN(vlax-get pl 'OBJECTNAME))
	 (IF (= plN  "AcDbCircle")
	   (PROGN
	   (setq pOIT(vlax-get pl 'CENTER))

	    (setq oCogo(vlax-invoke points 'add pOIT)) 
	    (setq pntnums (vlax-get oCogo 'number))
	              
            (setq pOITXY NIL)
	   (setq pOITZ NIL)
            (setq pOIT NIL)
	   

	   ))

	   
     

	
	)
	);;WW
    );;;;;;;;;;;;;;;;;;;progn
    );;;;;;;;;;;;;;;;;;;;;;;;;;;IF
 (command "_undo" "_end")
(setvar "CMDECHO" 1)
    (princ)
  
  
  );;;;;;;;;;;;;;;;;;;;;;;;MMM


Q10.gif

 

Message 4 of 6

crepinmoussavou
Explorer
Explorer

Hi  Hosneyalaa,

thank you for the idea. I already work with this command. But out of sheer laziness, I looked for an easier solution 😅.

0 Likes
Message 5 of 6

crepinmoussavou
Explorer
Explorer

Thank you very much Honeyalaa.

 

Message 6 of 6

ozgur_ege
Observer
Observer

Merhaba gayet güzel çalışıyor

0 Likes