In Jay Peak, we have provided the ability to create stacked profile views through the API. We did this by providing new overloads to the already existing methods that created profile views. The ‘ProfileView’ class exposes several ‘Create()’ and, as we saw last week, ‘CreateMultiple()’ methods to create single and multiple profile views. We also provided overloads for these methods that take a ‘StackedProfileViewsCreationOptions’ object, which defines how stacked profiles can be created.
The following example uses some of the code from last week to create multiple stacked profiles:
C#
private void createStackedProfileViews()
{
ProfileView.CreateMultiple(_alignmentId, _insertionPoint,
_stackedOptions, _creationOptions);
}
private StackedProfileViewsCreationOptions _stackedOptions
{
get
{
StackedProfileViewsCreationOptions options =
new StackedProfileViewsCreationOptions(_defaultPVId,
_defaultPVId, _defaultPVId);
return options;
}
}
private ObjectId _defaultPVId
{
get
{
return _civildoc.Styles.ProfileViewStyles[0];
}
}
VB.NET
Private Sub createStackedProfileViews()
ProfileView.CreateMultiple(_alignmentId, _insertionPoint,
_stackedOptions, _creationOptions)
End Sub
Private ReadOnly Property _stackedOptions() _
As StackedProfileViewsCreationOptions
Get
Dim options As New StackedProfileViewsCreationOptions(
_defaultPVId, _defaultPVId, _defaultPVId)
Return options
End Get
End Property
Private ReadOnly Property _defaultPVId() As ObjectId
Get
Return _civildoc.Styles.ProfileViewStyles(0)
End Get
End Property
And with this installment, we complete the Jay Peak series. It has been many weeks of Jay Peak goodness, which I hope you have enjoyed and that allows you to derive great benefit from our latest release. The series has covered the most important features and enhancements we added, but there are some other gems that we will be looking at in the future, so stay tuned for more Civil 3D API talk.