I'm trying to convert all surface elevation labels to customized blocks all at once. I spent several hours to figure out how to get the label coordinates where to insert the block, but failed. Below is beginning of my lisp:
(defun c:gaet3 (/ ELEV SS LBL PT)
(setq All_lbls (ssget "x" (list (cons 0 "AECC_SURFACE_ELEVATION_LABEL")))
len (sslength All_lbls)
ctr 0)
(while (< ctr len)
(setq lblobj (ssname All_lbls ctr))
Then what to do? I tried (entget lblobj), but no coordinates and elevation information shown in the result.
FeatureLabel.LabelLocation has not been exposed to LISP API; for that you're going to have to use .NET API to do what you're after, or use .NET API to at least expose a custom LispFunction Method to make it so you can do what you're after in LISP.
Simplest path without using .NET API, is to simply export your Civil drawing and replace the blocks in the resultant drawing (produced from Labels) with your desired blocks, then do with those what you need.
HTH
"How we think determines what we do, and what we do determines what we get."
Edit: Too slow....
You will need to use a .NET solution, as the location property is not exposed in the COM API:
; Property values:
; Application (RO) = #<VLA-OBJECT IAeccApplication 0000022b1c108370>
; Description = Civil 3D API: The parameter is incorrect.
; DisplayName (RO) = Civil 3D API: The parameter is incorrect.
; Document (RO) = #<VLA-OBJECT IAeccDocument 0000022b1c108250>
; EntityTransparency = "ByLayer"
; Flipped = 0
; Handle (RO) = "2146A"
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000022afa870618>
; LabelStyle = #<VLA-OBJECT IAeccLabelStyle 0000022af6e8a740>
; Layer = "C-TOPO-TEXT-FG"
; LeaderAttachmentOption = 0
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; MarkerStyle = #<VLA-OBJECT IAeccMarkerStyle 0000022af6cac350>
; Material = "ByLayer"
; Name = Civil 3D API: The parameter is incorrect.
; ObjectID (RO) = 42
; ObjectName (RO) = "AeccDbSurfaceElevLabel"
; OwnerID (RO) = 43
; Pinned = 0
; PlotStyleName = "ByLayer"
; Reversed = 0
; ShowToolTip = Civil 3D API: The parameter is incorrect.
; Surface (RO) = #<VLA-OBJECT IAeccTinSurface 0000022af7bd9140>
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000022afa870010>
; Type (RO) = 9
; Visible = -1
; Methods supported:
; ArrayPolar (3)
; ArrayRectangular (6)
; Copy ()
; Delete ()
; GetBoundingBox (2)
; GetExtensionDictionary ()
; GetXData (3)
; Highlight (1)
; IntersectWith (2)
; IsReferenceObject ()
; IsReferenceStale ()
; IsReferenceSubObject ()
; IsReferenceValid ()
; Mirror (2)
; Mirror3D (3)
; Move (2)
; Rotate (2)
; Rotate3D (3)
; ScaleEntity (2)
; SetXData (2)
; TransformBy (1)
; Update ()
Hi
If you don't want to use .NET API
as an idea
Can you detonate a surface elevation label And treat it like a block