I’m trying to do something I considered simple but I’m stuck.
I’ve got a drawing containing an alignment, a profile, a profile view, some assemblies and a corridor. I’d like to “mark” the start/end of all corridor regions in my profile view (with a (vertical) polyline or a point or something like that).
I started off by extracting the start/end-stations of all corridor regions which wasn’t too complicated.
Now I’d like to draw something at those stations in my (existing!) profile view.
If I were to create a new profile view I could use the “ProfileView.ByAlignmentPointName”-Node which takes “insertPoint” as an input. However, my profile view already exists and I need to get its insertion point.
I was only able to get the profile view’s bounding box with the “ProfileView.Extents”-Node but this only gives me height and length of my profile view and no absolute coordinates.
So, in short: Is there a way to query the insertion point coordinates of an existing profile view?
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 System.Collections.Generic import Dictionary
adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument
from Autodesk.DesignScript.Geometry import *
output = 
if not profileViews:
if not isinstance(profileViews, list):
profileViews = [profileViews]
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
for profileView in profileViews:
profileViewId = profileView.InternalObjectId
obj = t.GetObject(profileViewId, OpenMode.ForRead)
Profile_View_Name = obj.Name
OUT = get_profileView_info(IN)
A gentleman and a scholar! Both methods work great.
Thank you very much!
As a little follow up:
Am I right that “ObjectExtensions.GetParameters” doesn’t retrieve the vertical exaggeration of my profile view? Is there a way to get this value?
Sorry, I don’t follow:
I can’t find anything of interest here.
The vertical exaggeration value would also be necessary to find the lowest and highest point of my profile view (not the profile)
Sorry my English is not good
can i have a picture vertical exaggeration
and tomorrow I’m trying to help you
Thanks for your help and sorry for my late response!
This works for me as I’m trying do draw vertical lines from the lowest to the highest points of my profile view.
With this bounding box method I can retrieve the absolute height, regardless of the vertical exaggeration of my profile view.
(I’m still interested in how to get the value of the vertical exaggeration but I’ll open another thread for that matter so things don’t get to confusing)
Again - thank you for fast and qualified help!
@pumpaij FYI there are some nodes in Camber to accomplish this.
@mzjensen, I’ve been looking for the node ‘ProfileView.GetFromCivilObject’ for some time but can’t find it. Is it still available, or has it been withdrawn from 4.2.6?
Thanks in advance.
That has been replaced. There’s now a single node, Convert to Camber Object, that you can use instead.
Thanks, Zachri @mzjensen,
I really admire the work you’ve done. It’s an inspiration for those of us who are still learning. Congratulations!!