For whatever reason (this was already badly implemented in Civil3d as one wasn’t able to retrieve the vertical exaggeration of a profile view via expressions) and while seemingly everything else is covered, this value doesn’t show up in the ObjectExtensions.GetParameters-Node:
Let’s say I want to insert some blocks in my profile view and set their Y-Scale to the vertical exaggeration of my profile view. How would I do this?
To clarify with an example: let’s take a fictional profile view with a vertical extent of 15m, a vertical exaggeration of 10 and one design profile:
I can get the absolute height of my profile view with a bounding box so it’ll be 150m in this example. Unfortunately, I’m not sure how this information came to be - it could just as well be a profile view with a vertical extent of 150m and a vertical exaggeration of 1.
I can also retrieve the ElevationMin and ElevationMax of my profile view. However, if my profile view is set to automatic in the Elevation Range Tab it won’t retrieve the real (visible) min- and max elevations but the ones from my design profile. In this example it could be something like ElevationMin = 1.367 and ElevationMax = 5.393. So I’m not sure how I could work with those values.
Any help is much appreciated!
tl;dr: I want to get the vertical exaggeration of a Civil3d-ProfileView as a numeric value.
Right, that’s true. But does that also mean that there’s no way to get this information?
There’s no way to “inspect” styles for anything but their name, right?
import clr
clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
def get_profile_view_exaggeration(styleName):
adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument
if not styleName:
return
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
pvStyle = t.GetObject(cdoc.Styles.ProfileViewStyles[styleName], OpenMode.ForRead)
result = pvStyle.GraphStyle.VerticalExaggeration
t.Commit()
pass
return result
OUT = get_profile_view_exaggeration(IN[0])