TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: milanp on September 22, 2020, 06:02:53 PM
-
Hello
I use this lisp to put a specific block on a selected point. Does anyone have any idea how this can be applied to COGO points in Civil3d. Thanks!
(defun C:k1 ( / ss blk n)
(if (and (setq ss (ssget '((0 . "POINT"))))
(setq blk "T62-04"))
(repeat (setq n (sslength ss))
(command "layer" "make" "T62-04" "")
(command "_.-insert" blk
"_s" 1
"_r" 0
"_none" (cdr (assoc 10 (entget (ssname ss (setq n (1-
n)))))))))
(princ)
)
-
I don't use civil but have you tried using "AECC_COGO_POINT" instead of "POINT" in the ssget?
-
(setq ptObj (vlax-ename->vla-object (ssname ss n))
(setq desc (vlax-put ptObj 'rawdescription " ttyt"))
-
https://www.theswamp.org/index.php?topic=55528.0
-
The cogo point you can use EASTING NORTHING for insertion point or LOCATION using VL-get method. You can use point DESCRIPTION also once you have selection set, NUMBER also.
-
I couldn't solve it. This is the only way I have found a solution
(defun c:k1 ( / blk pt)
(if (and (setq blk "T62-04")
(setq pt (getpoint "\nSpecify insertion point: "))
)
(command "_.insert" blk "_S" 1 "_R" 0 "_NONE" pt)
)
(princ)
)
-
(defun c:k1 ( / blk pt)
(if (and (setq blk "T62-04")
(setq eName (vlax-ename->vla-object(car (entsel "\nSelect a AECC_COGO_POINT "))))
(setq pt (mapcar '(lambda ( p ) (vlax-get eName p)) '( easting northing elevation)))
)
(command "_.insert" blk "_S" 1 "_R" 0 "_NONE" pt)
)
(princ)
)
-
HI
-
Everything works great! Thank you very much! :-)
-
Is there an aversion to creating a style you can assign to the point? All of which could show the block and label, and be dynamically linked. You could even create a description code to auto assign the style to the point matching a specific raw description (if that's something you're doing).
-
I use that method if the surveyor is automatically assigned descriptions in the field during the survey. This is not the case now and I enter the blocks manually in dwg model space. Blocks are also assigned in places that are not measured in the field, so I cannot add a description in the txt file of points. Thanks for the advice