# Load the Python Standard and DesignScript Libraries
import sys
import clr
# Add Assemblies for AutoCAD and Civil3D
clr.AddReference("AcMgd")
clr.AddReference("AcCoreMgd")
clr.AddReference("AcDbMgd")
clr.AddReference("AecBaseMgd")
clr.AddReference("AecPropDataMgd")
clr.AddReference("AeccDbMgd")
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
# from Autodesk.AutoCAD.Geometry import *
# from Autodesk.Civil import *
# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil.DatabaseServices import AlignmentGeometryPointStationType
# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor
A = IN[0]
ListPK = IN[1]
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
# Place your code below
# GeometryPointSelector.SelectAll
align = A.InternalDBObject
# Station = []
# Vse to4ki geometrii
statAll = align.GetStationSet(StationTypes.All)
# Точки геометрии
statGeom = align.GetStationSet(StationTypes.GeometryPoint)
# Точки основных пикетов - da tex 4to idut u menia kazdyje 100m dopustim
statMajo = align.GetStationSet(StationTypes.Major)
# Точки чего? eto Station Equation, nepravelnyje pikety, t.e. pikety sdvinutyje ot pravlenyx (kotoryje kazdyje 100m). iz Civil dostupny po Alignment Priperties->station control.
statEqua = align.GetStationSet(StationTypes.Equation)
# Вывод данных о точках геометрии
statSupTrPo = align.GetStationSet(StationTypes.OffsetTargetCurveOnly)
st_All = []
st_All1 = []
st_Geom = []
st_Geom1 = []
st_Mj0 = []
st_Mj = []
st_Mj1 = []
st_Eq = []
st_STP0 = []
st_STP1 = []
st_All.append("ПК ВСЕХ\nточек геометрии")
st_All1.append("Названия ВСЕХ\nточек геометрии")
st_Geom.append("ПК точек\nгоризонтальной геометрии")
st_Geom1.append("Названия точек\nгоризонтальной геометрии")
st_Eq.append("Неправильные\nПК")
st_Mj1.append("Названия основных ПК")
st_Mj0.append("основные ПК")
st_STP0.append("Station.RawStation")
st_STP1.append("Station.StationType")
for Station in statAll:
st_All.append(Station.RawStation)
st_All1.append(Station.StationType)
for Station in statGeom:
st_Geom.append(Station.RawStation)
st_Geom1.append(Station.StationType)
for Station in statMajo:
st_Mj0.append(Station.RawStation)
st_Mj1.append(Station.StationType)
for Station in statEqua:
st_Eq.append(Station.RawStation)
for Station in statSupTrPo:
st_STP0.append(Station.RawStation)
st_STP1.append(Station.StationType)
x = 0
st_Geom_2 = []
st_Geom_2.append(("Enumeration ВСЕХ\nточек геометрии"))
# while len(statAll) > x:
# st_Geom_2.append(statAll[x].GeometryStationType)
# x += 1
# for Station in statSupTrPo:
# st_Geom_2.append(Station.GeometryStationType)
for Station in statAll:
st_Geom_2.append(Station.GeometryStationType)
# oProfile = t.GetObject(align.GetProfileIds()[0], OpenMode.ForRead)
t.Commit()
pass
# Assign your output to the OUT variable.
OUT = st_All, st_All1, st_Geom_2
# OUT = oProfile.GetType(), dir(oProfile)