Extract AECC_COGO_POINT information

Extract AECC_COGO_POINT information

Anonymous
Not applicable
2,818 Views
12 Replies
Message 1 of 13

Extract AECC_COGO_POINT information

Anonymous
Not applicable
Hi all,

Any idea how to extract the information of "AECC_COGO_POINT" of CIVIL3D 2008 such as the x,y,z coordinates using Lisp programming.
In LDT 2005 the information can be extract using "ENTGET". Thanks.
0 Likes
2,819 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
Use the ActiveX API. In 2008 you can use normal selection methods to select
the point. In 2007 you must use the SelectPoints method of the Points
collection of the Drawing.....here's an example I made to retrieve the
elevation of points for 2007 (also works with 2008):

;;Get Point elevations....
(setq *acad* (vlax-get-acad-object))
(setq C3D (vla-getinterfaceobject *acad* "AeccXUiLand.AeccApplication.4.0"))
(setq C3Ddoc (vla-get-activedocument C3D))
(setq pnts (vlax-get C3Ddoc 'points))
;;ask to select points
(princ "\nSelect points to query the elevations of: ")
(setq selectedPnts (vlax-invoke C3Ddoc 'SelectPoints))
(foreach pnt selectedPnts
(setq elev (vlax-get (vlax-invoke pnts 'find pnt) 'elevation))
(princ (strcat "\nElevation of Pt#" (itoa pnt) " = " (rtos elev 2 2)))
)

Use the Easting & Northing propoerties to obtain the x/y values.

HTH,
Jeff

wrote in message news:5620250@discussion.autodesk.com...
Hi all,

Any idea how to extract the information of "AECC_COGO_POINT" of CIVIL3D 2008
such as the x,y,z coordinates using Lisp programming.
In LDT 2005 the information can be extract using "ENTGET". Thanks.
0 Likes
Message 3 of 13

Anonymous
Not applicable
Hi Jeff,

Thaks for the reply, i will try this and check the results thanks again.

Freddie
0 Likes
Message 4 of 13

Anonymous
Not applicable
Hi Jeff;

I have problem loading the lisp. i doesnt load (vla-getinterfaceobject*acad* "AeccXUiLand.AeccApplication.4.0"). Can you help me load the lisp program. thanks for the help.

Freddie
0 Likes
Message 5 of 13

Anonymous
Not applicable
If you are using 2008 then the line
(setq C3D (vla-getinterfaceobject *acad* "AeccXUiLand.AeccApplication.4.0"))
needs to be
(setq C3D (vla-getinterfaceobject *acad* "AeccXUiLand.AeccApplication.5.0"))


Jon
0 Likes
Message 6 of 13

Anonymous
Not applicable
Hi Jon,

Thanks for the reply, also can ask how to Use the Easting & Northing properties to obtain the x/y values. thanks.
0 Likes
Message 7 of 13

Anonymous
Not applicable
Oops, sorry about the version thing. Thanks, Jon, for picking up on that.
This will get the XYZ values:

(foreach pnt selectedPnts
(setq pt (vlax-invoke pnts 'find pnt)
z (vlax-get pt 'elevation)
x (vlax-get pt 'easting)
y (vlax-get pt 'northing)
)
;;do whatever you want with the x y z values......
)

wrote in message news:5627367@discussion.autodesk.com...
Hi Jon,

Thanks for the reply, also can ask how to Use the Easting & Northing
properties to obtain the x/y values. thanks.
0 Likes
Message 8 of 13

Anonymous
Not applicable
I learned the version thing from you in the first place Jeff.

Jon

"Jeff Mishler" wrote in message
news:5627788@discussion.autodesk.com...
Oops, sorry about the version thing. Thanks, Jon, for picking up on that.
This will get the XYZ values:

(foreach pnt selectedPnts
(setq pt (vlax-invoke pnts 'find pnt)
z (vlax-get pt 'elevation)
x (vlax-get pt 'easting)
y (vlax-get pt 'northing)
)
;;do whatever you want with the x y z values......
)

wrote in message news:5627367@discussion.autodesk.com...
Hi Jon,

Thanks for the reply, also can ask how to Use the Easting & Northing
properties to obtain the x/y values. thanks.
0 Likes
Message 9 of 13

Anonymous
Not applicable
hello,

thanks guys for your reply this is acatually what i did;

(foreach pnt selectedPnts
(setq elev (vlax-get (vlax-invoke pnts 'findpnt) 'elevation)
eastng (vlax-get (vlax-invoke pnts 'find pnt) 'easting)
northng (vlax-get (vlax-invoke pnts 'findpnt) 'northing)
info_line (strcat (itoa pnt) "\t" (rtos northng 2 2) "," (rtos eastng 2 2) "," (rtos elev 2 2))
)
(write-line info_line f)

one more question what if i want to include other informations such as Primary point group, Raw Description, Full Description etc. is it adding another setq? and also how to insert that into my info_line? another thing last time i load this routine it works properly and now i load it again, it gives me this error ;error: Civil 3D API: The parameter is incorrect.

freddie

Message was edited by: freddie.inno
0 Likes
Message 10 of 13

Anonymous
Not applicable
The Primary point group is a bit more complicated. Look into iterating the
PointGroups collection, finding which one(s) it belongs to, capture the
DrawPriority of the Group(s). The Primary group is the one with the lowest
number (I think).

To include the other information, just do as you've done for the NEZ.....
'rawdescription 'fulldescription

I am not sure what may be causing that error. Could you post your entire
code?


wrote in message news:5631868@discussion.autodesk.com...

one more question what if i want to include other informations such as
Primary point group, Raw Description, Full Description etc. is it adding
another setq? and also how to insert that into my info_line? another thing
last time i load this routine it works properly and now i load it again, it
gives me this error ;error: Civil 3D API: The parameter is incorrect.
0 Likes
Message 11 of 13

Anonymous
Not applicable
Freddie,
One other comment I should make. While all this can be done in lisp, I think
you will find it worth your while to investigate coding in VBA. You will end
up having a much easier time trying to figure out what Objects support what
Properties & Methods. I know, I walked the on the light lisp side for quite
a while, but now I've even done some things with C#.NET that I can't even
think of trying in lisp.

Just something to ponder.....
0 Likes
Message 12 of 13

Anonymous
Not applicable
Hi Jeff,

Thanks for your help, actually im thinking of doing that in .NET and ofcourse, I may take some time to learn and hopefully I can be good programmer like you. thanks again.
0 Likes
Message 13 of 13

Anonymous
Not applicable
Another one switches from LISP!

Peter Funk
Civil 3D Product Manager
Autodesk, Inc.
0 Likes