Alignment offset label

Hello, is there any way to select all alignment station offset labels by selecting the alignment associated with these

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:

  1. Get all of the Labels on the layer using an All Objects On Layer node
  2. Use the Convert to Camber Object node to get the Labels in the right format
  3. Get the Alignment of each Label using AlignmentStationOffsetLabel.Alignment, as shown in your screenshot
  4. Get the names of the Alignments using CivilObject.Name
  5. Put in a string node with the name of the desired Alignment, then check that against the list of Alignments using an == node.
  6. Filter the list of Labels from step 2 with a List.FilterByBoolMask node using the boolean result of step 5 as the mask.

accessible by GetLabelIds()

import clr


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)
	return output

OUT = Get_staoff_label(IN[0])