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 SetAmbientSettingsElevation(Autodesk.Civil.LinearUnitType unit, int precision, Autodesk.Civil.RoundingType rounding, Autodesk.Civil.SignType sign) | |
{ | |
civilDoc.Settings.DrawingSettings.AmbientSettings.Elevation.Unit.Value = unit; | |
civilDoc.Settings.DrawingSettings.AmbientSettings.Elevation.Precision.Value = precision; | |
civilDoc.Settings.DrawingSettings.AmbientSettings.Elevation.Rounding.Value = rounding; | |
civilDoc.Settings.DrawingSettings.AmbientSettings.Elevation.Sign.Value = sign; | |
} |
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 setAlignmentPointEntityData(Autodesk.Civil.Land.Settings.AbbreviationAlignmentEnhancedType abvtype, string abv) | |
{ | |
civilDoc.Settings.DrawingSettings.AbbreviationsSettings.AlignmentGeoPointEntityData.SetAlignmentEnhancedAbbreviation(abvtype, abv); | |
} | |
public void setSuperElevationAbv(Autodesk.Civil.Land.Settings.AbbreviationSuperelevationType abvType, string abv) | |
{ | |
civilDoc.Settings.DrawingSettings.AbbreviationsSettings.Superelevation.SetSuperelevationAbbreviation(abvType, abv); | |
} |
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 setAlignmnetAbv(Autodesk.Civil.Land.Settings.AbbreviationAlignmentType abvType, string abv) | |
{ | |
civilDoc.Settings.DrawingSettings.AbbreviationsSettings.AlignmentGeoPointText.SetAlignmentAbbreviation(abvType, abv); | |
} |
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 setInfinityAbv(string abv) | |
{ | |
civilDoc.Settings.DrawingSettings.AbbreviationsSettings.GeneralText.Infinity = abv; | |
} | |
public void setLeftAbv(string abv) | |
{ | |
civilDoc.Settings.DrawingSettings.AbbreviationsSettings.GeneralText.Left = abv; | |
} |
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 SetAlignmentLayer(string layerName, Autodesk.Civil.Settings.ObjectLayerModifierType modifierType, string modifierValue, Boolean locked) | |
{ | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).LayerName = layerName; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).Modifier = modifierType; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).ModifierValue = modifierValue; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).Locked = locked; | |
} | |
public void SetAlignmentLayer(string layerName) | |
{ |
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
#region Object Layer Settings | |
public void SetAlignmentLayer(string layerName, Autodesk.Civil.Settings.ObjectLayerModifierType modifierType, string modifierValue, Boolean locked) | |
{ | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).LayerName = layerName; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).Modifier = modifierType; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).ModifierValue = modifierValue; | |
civilDoc.Settings.DrawingSettings.ObjectLayerSettings.GetObjectLayerSetting(Autodesk.Civil.Settings.SettingsObjectLayerType.Alignment).Locked = locked; | |
} |
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
[CommandMethod("addGeneralLabelStyle")] | |
public void addGeneralLabelStyle() // This method can have any name | |
{ | |
ObjectId labelStyleId = getGeneralLabelStyle("Asphalt"); | |
if (labelStyleId == ObjectId.Null) | |
{ | |
labelStyleId = addGeneralLabelStyel("Asphalt"); | |
} | |
setGeneralProperties(labelStyleId, "SHR", "C-ROAD-LABL", true, Autodesk.Civil.OrientationReferenceType.View, true, 110, true); | |
setTextComponentContents(labelStyleId, "ASPHALT", "Asphalt"); |
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 setTextComponentContents(ObjectIdCollection componentIds, string contentString, string componentName) | |
{ | |
Document acadDoc = Application.DocumentManager.MdiActiveDocument; | |
CivilDocument civilDoc = CivilApplication.ActiveDocument; | |
using (Transaction trans = acadDoc.Database.TransactionManager.StartOpenCloseTransaction()) | |
{ | |
foreach (ObjectId id in componentIds) | |
{ | |
LabelStyleTextComponent textComponent = trans.GetObject(id, OpenMode.ForWrite) as LabelStyleTextComponent; | |
textComponent.Name = componentName; |
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 setTextComponentContents(ObjectId labelStyleId, string contentString, string componentName) | |
{ | |
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; | |
LabelStyleTextComponent textComponent = trans.GetObject(lblStyle.GetComponents(LabelStyleComponentType.Text)[0], OpenMode.ForWrite) as LabelStyleTextComponent; | |
textComponent.Name = componentName; | |
textComponent.Text.Contents.Value = contentString; |
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 ObjectIdCollection getLabelStyleComponentIds(ObjectId labelStyleId, LabelStyleComponentType componentType) | |
{ | |
ObjectIdCollection componentIds = new ObjectIdCollection(); | |
Document acadDoc = Application.DocumentManager.MdiActiveDocument; | |
CivilDocument civilDoc = CivilApplication.ActiveDocument; | |
using (Transaction trans = acadDoc.Database.TransactionManager.StartOpenCloseTransaction()) | |
{ | |
LabelStyle lblstyle = trans.GetObject(labelStyleId, OpenMode.ForRead) as LabelStyle; | |
componentIds = lblstyle.GetComponents(componentType); | |
trans.Commit(); |
NewerOlder