Hi Everyone!
I want to get the Points of the Start.Pipe and End.Pipe on the profie view, I need your help!
Thanks in advance…
Hi @lebinhx3c2012,
Is this what you’re looking for?
Great! Can you give me the file .dyn.
Here is what I came up with to roughly place mtext invert labels. I highly suggest using what Zachri has made though as he is much more experienced. But perhaps you can scrub something out of my novice late night stream of conscious coding! Cheers.Invert Labels.dyn (42.6 KB)
Here’s the Python script.
IN[0] = Profile View object
IN[1] = station (or list of stations)
IN[2] = elevation (or list of elevations)
The number of stations should match the number of elevations.
import sys
import clr
clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('ProtoGeometry')
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.Civil.DatabaseServices import *
adoc = Application.DocumentManager.MdiActiveDocument
from Autodesk.DesignScript.Geometry import *
def get_profile_view_points(profileView, station, elevation):
global adoc
output = []
if not isinstance(station, list) and not isinstance(elevation, list):
station = [station]
elevation = [elevation]
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
for i in range(0, len(station)):
oid = profileView.InternalObjectId
obj = t.GetObject(oid, OpenMode.ForRead)
if isinstance(obj, ProfileView):
flag, x, y = obj.FindXYAtStationAndElevation(station[i], elevation[i], 0, 0)
output.append(Point.ByCoordinates(x, y, 0))
t.Commit()
return output
OUT = get_profile_view_points(IN[0], IN[1], IN[2])
Hi @zachri.jensen ,
Why list of station Pipe All equal to zero.
Do the pipes have a reference alignment set?
Thanks for sharing the .dyn file!
Hi @NelsonNZ!
37.Tao Profile Tam va Day Cong.dyn (221.9 KB)