.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modfiy Profile View Direction

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
conormccartney3897
556 Views, 2 Replies

Modfiy Profile View Direction

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

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: conormccartney3897

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
conormccartney3897
in reply to: Jeff_M

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost