Hello, is there any way to select all alignment station offset labels by selecting the alignment associated with these
Hi
I did not understand you well
Try this, it may help you
Sorry for my poor english.
My problem is that i need to select all the greens offset labels in the drawing by picking the alignment.
The objective of this is to change all the offset labels styles.
I think the inverse of this, need input alingment, output select all the station labels of this alingment.
I think this would be the way to go. Assuming all of the labels are on the same layer:
- Get all of the Labels on the layer using an All Objects On Layer node
- Use the Convert to Camber Object node to get the Labels in the right format
- Get the Alignment of each Label using AlignmentStationOffsetLabel.Alignment, as shown in your screenshot
- Get the names of the Alignments using CivilObject.Name
- Put in a string node with the name of the desired Alignment, then check that against the list of Alignments using an == node.
- Filter the list of Labels from step 2 with a List.FilterByBoolMask node using the boolean result of step 5 as the mask.
hi
accessible by GetLabelIds()
import clr
clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil.DatabaseServices.Styles import *
adoc = Application.DocumentManager.MdiActiveDocument
civdoc = CivilApplication.ActiveDocument
alignment = IN[0]
def Get_staoff_label(alignment):
global adoc
global civdoc
output = []
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
alignmentId = alignment.InternalObjectId
obj = t.GetObject(alignmentId, OpenMode.ForWrite)
if isinstance(obj, Alignment):
for point in obj.GetLabelIds():
obj0 =t.GetObject(point,OpenMode.ForWrite)
output.append(obj0)
t.Commit()
return output
OUT = Get_staoff_label(IN[0])
https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=5fb37cb9-9811-3f98-343e-1d6098fc849a
https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=625c1c3b-ec2e-d216-f366-b535de728379