Modfiy Profile View Direction

Modfiy Profile View Direction

Anonymous
Not applicable
1,023 Views
2 Replies
Message 1 of 3

Modfiy Profile View Direction

Anonymous
Not applicable

For Civil 3d 2013, im looking for a method to change the Profile View Direction of a Profile View Style in VB.NET.

0 Likes
Accepted solutions (1)
1,024 Views
2 Replies
Replies (2)
Message 2 of 3

Jeff_M
Consultant
Consultant
Accepted solution

In case you weren't aware, there is a forum specifically for C3D Customization:

http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/bd-p/190

 

The GraphStyle property of the PVStyle sets the direction

 

oProfileViewStyle.GraphStyle.Direction = GraphDirectionType.RightToLeft

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3

Anonymous
Not applicable

ah yes, i had forgotten about that forum. ah well that was pretty easy, i was missing an import so i never saw teh "ProfileViewStyle", thanks for the help! heres what i did with it:

Imports System
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.Civil
Imports Autodesk.Civil.ApplicationServices
Imports Autodesk.Civil.DatabaseServices.Styles
Imports Autodesk.Civil.Settings

' This line is not mandatory, but improves loading performances
<Assembly: CommandClass(GetType(ProfileLabelSettings.MyCommands))> 
Namespace ProfileLabelSettings
    Public Class MyCommands
        <CommandMethod("profilelabelsettingsbottom")>
        Public Sub proflabbot()
            Dim cdoc As CivilDocument = CivilApplication.ActiveDocument
            Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
            Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
            Dim proflabplace As SettingsCmdAddNetworkProfLabels = cdoc.Settings.GetSettings(Of SettingsCmdAddNetworkProfLabels)()
            Dim profviewstyle As ProfileViewStyle = Nothing
            Dim structbot As String
            Using tr As Transaction = db.TransactionManager.StartTransaction()
                If profviewstyle.GraphStyle.Direction = GraphDirectionType.LeftToRight Then
                    structbot = "MKA - Profile Structure Bottom Up Stream(L) to Down Stream(R)"
                Else
                    structbot = "MKA - Profile Structure Bottom Down Stream(L) to Up Stream(R)"
                End If
                Dim pipebot As String = "MKA - None"
                proflabplace.ProfileLabelPlacement.StructureLabelPlacement.Value = StructureProfileLabelPlacementType.AtStructureBottom
                proflabplace.Styles.StructureProfileLabel.Value = structbot
                proflabplace.ProfileLabelPlacement.DimensionAnchorOptionForStructures.Value = DimensionAnchorOptionType.Below
                proflabplace.ProfileLabelPlacement.DimensionAnchorPlotHeightValueForStructures.Value = 2 / 12
                proflabplace.Styles.PipeProfileLabel.Value = pipebot
                tr.Commit()
            End Using
            ed.WriteMessage(vbCrLf + "Structure Label Placement is: " + proflabplace.ProfileLabelPlacement.StructureLabelPlacement.Value.ToString())
            ed.WriteMessage(vbCrLf + "Structure Label is: " + proflabplace.Styles.StructureProfileLabel.Value.ToString())
            ed.WriteMessage(vbCrLf + "Pipe Label is: " + proflabplace.Styles.PipeProfileLabel.Value.ToString())
        End Sub
        <CommandMethod("profilelabelsettingstop")>
        Public Sub proflabtop()
            Dim cdoc As CivilDocument = CivilApplication.ActiveDocument
            Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
            Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
            Dim proflabplace As SettingsCmdAddNetworkProfLabels = cdoc.Settings.GetSettings(Of SettingsCmdAddNetworkProfLabels)()
            Dim structop As String = "MKA - Profile Structure Top"
            Dim pipetop As String = "MKA - Size Slope Profile"
            Using tr As Transaction = db.TransactionManager.StartTransaction()
                proflabplace.ProfileLabelPlacement.StructureLabelPlacement.Value = StructureProfileLabelPlacementType.AtStructureTop
                proflabplace.Styles.StructureProfileLabel.Value = structop
                proflabplace.ProfileLabelPlacement.DimensionAnchorOptionForStructures.Value = DimensionAnchorOptionType.Above
                proflabplace.ProfileLabelPlacement.DimensionAnchorPlotHeightValueForStructures.Value = 1 / 12
                proflabplace.Styles.PipeProfileLabel.Value = pipetop
                tr.Commit()
            End Using
            ed.WriteMessage(vbCrLf + "Structure Label Placement is: " + proflabplace.ProfileLabelPlacement.StructureLabelPlacement.Value.ToString())
            ed.WriteMessage(vbCrLf + "Structure Label is: " + proflabplace.Styles.StructureProfileLabel.Value.ToString())
            ed.WriteMessage(vbCrLf + "Pipe Label is: " + proflabplace.Styles.PipeProfileLabel.Value.ToString())
        End Sub
    End Class
End Namespace

 

0 Likes