Author Topic: Need to access "Description" from AECC_COGO_POINT  (Read 1948 times)

0 Members and 1 Guest are viewing this topic.

K12RS

  • Guest
Need to access "Description" from AECC_COGO_POINT
« on: August 14, 2015, 12:23:39 PM »
Please forgive any wrongdoings
This is my first post
As the title says, I'm trying to access the "Description" from an AECC_COGO_POINT so I can change that entity to a layer based on said Description.

I'm not aprogramming guru but have been doing fine with lisp for years without hurting my brain to learn new stuff.
But perhaps it's time.

LSP code from LDD worked great

Code: [Select]
(partial)
     (setq elist (entget ename))
     (setq ptype (cdr (assoc 0 elist)))    ;find primative type

     (if (= ptype "AECC_COGO_POINT")
         (progn
            (Read-Description)
            (Change-desc-to-Layer-name)
            (Make-Layer-Change)
         ) ;end progn
     ) ;end if



(defun Read-Description()
   (setq ename1 (entget ename))
   (setq desc  (cdr (assoc 302 elist)))

   (if (or (= desc " ") (= desc "") (= desc "."))
       (setq desc "null")
   ); end if
); end Read-Next-Attribute

PLEASE - any ideas or links?
Thanks

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Need to access "Description" from AECC_COGO_POINT
« Reply #1 on: August 14, 2015, 12:40:19 PM »
Welcome to the Swamp, K12RS!

For Civil3D objects you need to use ActiveX/COM, as they don't have DXF codes for most of the properties.
Make sure you run the single line:
(vl-load-com)
at least once per session. This makes sure you can use the vla-, vlax-, functions.

Code - Auto/Visual Lisp: [Select]
  1.    (setq ptObj (vlax-ename->vla-object ename))
  2.    (setq desc  (vlax-get ptObj 'rawdescription))
  3.  
  4.  

K12RS

  • Guest
Re: Need to access "Description" from AECC_COGO_POINT
« Reply #2 on: August 14, 2015, 01:59:59 PM »
Worked!
THANK YOU

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Need to access "Description" from AECC_COGO_POINT
« Reply #3 on: August 14, 2015, 04:32:17 PM »
Welcome to the Swamp.  8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.