Last active
August 29, 2015 13:57
-
-
Save Civil3DToolChest/9510019 to your computer and use it in GitHub Desktop.
setGeneralLabelStyleProperties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setGeneralProperties(ObjectId labelStyleId, string textStyle, string layer, bool visiblity, | |
Autodesk.Civil.OrientationReferenceType orientationReference, bool planReadability, double prBias | |
) | |
{ | |
Document acadDoc = Application.DocumentManager.MdiActiveDocument; | |
CivilDocument civilDoc = CivilApplication.ActiveDocument; | |
using (Transaction trans = acadDoc.Database.TransactionManager.StartOpenCloseTransaction()) | |
{ | |
LabelStyle lblstyle = trans.GetObject(labelStyleId, OpenMode.ForWrite) as LabelStyle; | |
lblstyle.Properties.Label.TextStyle.Value = textStyle; | |
lblstyle.Properties.Label.Layer.Value = layer; | |
lblstyle.Properties.Label.Visibility.Value = visiblity; | |
lblstyle.Properties.Behavior.OrientationReference.Value = orientationReference; | |
lblstyle.Properties.Behavior.InsertOption.Value = Autodesk.Civil.LabelInsertionType.None; | |
lblstyle.Properties.PlanReadability.PlanReadable.Value = planReadability; | |
prBias = convertDegreeToRadian(prBias); | |
lblstyle.Properties.PlanReadability.PlanReadableBias.Value = prBias; | |
trans.Commit(); | |
} | |
} | |
public double convertDegreeToRadian(double degree) | |
{ | |
// degree * (pi /180) = radian | |
double radian = degree * (System.Math.PI / 180); | |
return radian; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment