View Full Version : Tapping into Civil 3D labels
Coolmo
2008-05-01, 12:50 PM
I'd like to tap into a Civil 3D cross section label that labels the elevation and offset of a point inside a cross section. The label is already there, I simply want to select the label and have VBA spit out the elevation and offset of the label to a variable. Can anyone tell me if this is even possible and perhaps throw some code my way on how to do this? I'm hoping it's already "built into" out of the box Civil 3D so when I distribute the program within my company I don't have to chase the program around with loading a bunch of stuff. Thanks for any help on this.
Jeff_M
2008-05-01, 06:04 PM
If you are looking to get a label which has been placed per the settings of the Cross Section Style & Code Sets, I don't think these are accessible.
Even the basic StationOffset SectionView labels don't expose too much. Although you can get the StationOffset from a known XY location.
Maybe a small sample drawing with what you are trying to get would help?
Coolmo
2008-05-01, 06:49 PM
I doubt a drawing would help. You're right. I am talking about labels placed on a Civil 3D cross section set up by a style that reference the database. I figured you probably couldn't grab any info from these. I even tried to list the "dotted pairs" of the label entity through Lisp and all it gave me was
((-1 . <Entity name: 7ed0f500>) (0 . "AECC_OFFSET_ELEVATION_LABEL") (330 .
<Entity name: 7eff1cf8>) (5 . "20428") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "XGRIDT") (100 . "AecDbEntity") (102 . "{AEC_SUBOBJECT") (300 .
"AeccImpOffsetElevLabel") (100 . "AecImpObj") (3 . "") (100 . "AecImpEnt") (171
. 0) (100 . "AeccImpEnt") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}")
(100 . "AeccDbEntity") (100 . "AeccDbLabeling") (100 . "AeccDbLabel") (100 .
"AeccDbFeatureLabel") (100 . "AeccDbOffsetElevLabel"))
which is descriptive of the entity but not the content (that I can see). I'm VERY confused as to why there are so many "(100 . "blahblah")".
Oh well.
Jeff_M
2008-05-01, 08:19 PM
Yeah, the 100 codes are for a SubObject type...This just shows there there are many parent objects that this one derives it's methods & properties from.
AECC* objects do not have 'normal' DXF codes, anyway. All of the data is stuck away where DXF does no good. The only way to really work with them is via the ActiveX API, but even then you (we) are at the mercy of the C3D programmers. We can only use what they allow us to via what they expose in the API. I understand 2009 has more access to labels, but I do not know if that extends to the Section labels.
Coolmo
2008-05-02, 01:37 PM
Cool. Guess I gotta wait 'til we get 2009 over here. I suspect it'll be sometime in..... 2011! :roll:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.