Author Topic: Block on Cogo point  (Read 1541 times)

0 Members and 1 Guest are viewing this topic.

milanp

  • Newt
  • Posts: 35
Block on Cogo point
« 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!


Code: [Select]
(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)
)

Dlanor

  • Bull Frog
  • Posts: 263
Re: Block on Cogo point
« Reply #1 on: September 22, 2020, 06:39:51 PM »
I don't use civil but have you tried using "AECC_COGO_POINT" instead of "POINT" in the ssget?

HOSNEYALAA

  • Newt
  • Posts: 103
Re: Block on Cogo point
« Reply #2 on: September 22, 2020, 06:58:15 PM »
Code: [Select]
   (setq ptObj (vlax-ename->vla-object (ssname ss n))
   (setq desc  (vlax-put ptObj 'rawdescription " ttyt"))
 
 


HOSNEYALAA

  • Newt
  • Posts: 103
Re: Block on Cogo point
« Reply #3 on: September 22, 2020, 07:04:23 PM »

BIGAL

  • Swamp Rat
  • Posts: 1407
  • 40 + years of using Autocad
Re: Block on Cogo point
« Reply #4 on: September 22, 2020, 08:29:41 PM »
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.
A man who never made a mistake never made anything

milanp

  • Newt
  • Posts: 35
Re: Block on Cogo point
« Reply #5 on: September 23, 2020, 06:18:45 PM »
I couldn't solve it. This is the only way I have found a solution

Code: [Select]
(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)
  )

HOSNEYALAA

  • Newt
  • Posts: 103
Re: Block on Cogo point
« Reply #6 on: September 24, 2020, 02:43:36 AM »

Code: [Select]

(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)
  )



HOSNEYALAA

  • Newt
  • Posts: 103
Re: Block on Cogo point
« Reply #7 on: September 24, 2020, 02:44:22 AM »
HI

milanp

  • Newt
  • Posts: 35
Re: Block on Cogo point
« Reply #8 on: September 24, 2020, 05:18:42 AM »
Everything works great! Thank you very much!  :-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Block on Cogo point
« Reply #9 on: September 24, 2020, 09:08:28 AM »
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).
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

milanp

  • Newt
  • Posts: 35
Re: Block on Cogo point
« Reply #10 on: September 24, 2020, 03:54:17 PM »
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