public static string GetLayerName(Autodesk.AutoCAD.DynamoNodes.Document document, SettingsObjectLayerType objectType, string objectName = "") { CivilDocument civilDoc = Autodesk.Civil.ApplicationServices.CivilDocument.GetCivilDocument(document.AcDocument.Database); SettingsDrawing settingsDrawing = civilDoc.Settings.DrawingSettings; SettingsObjectLayers sOL = settingsDrawing.ObjectLayerSettings; SettingsObjectLayer sOLayer = sOL.GetObjectLayerSetting(objectType); string layerName = ""; string layerMod = sOLayer.ModifierValue; if (sOLayer.ModifierValue.Contains("*")) { layerMod = sOLayer.ModifierValue.Replace("*", objectName); } switch (sOLayer.Modifier) { case (ObjectLayerModifierType.Prefix): { layerName = layerMod + sOLayer.LayerName; break; } case (ObjectLayerModifierType.Suffix): { layerName = sOLayer.LayerName + layerMod; break; } default: { layerName = sOLayer.LayerName; break; } } return(layerName); }
private void LoadAllSettings() { this.drawingSettings = LoadSettings <SettingsDrawing>(localPath.FindFullPathFromXml("PathDrawing")); if (this.drawingSettings == null) { this.drawingSettings = SettingsDrawing.Default; } this.userSettings = LoadSettings <SettingsLand>(localPath.FindFullPathFromXml("PathUsers")); if (this.userSettings == null) { this.userSettings = SettingsLand.Default; } this.formSettings = LoadSettings <SettingsFormLand>(localPath.FindFullPathFromXml("PathFormLand")); if (this.formSettings == null) { this.formSettings = new SettingsFormLand(); } this.tableSettings = LoadSettings <SettingsTable>(localPath.FindFullPathFromXml("PathTables")); if (this.formSettings == null) { this.tableSettings = SettingsTable.Default; } this.frameDrawingSettings = LoadSettings <SettingsLand>(localPath.FindFullPathFromXml("PathFrameDrawing")); if (this.formSettings == null) { this.frameDrawingSettings = SettingsLand.Default; } }
//private int versionCAD; public ServiceParcel(LandParcel parcel, SettingsFormLand formSettings) { settingsDrawing = ServiceXml.ReadXml <SettingsDrawing>(localPath.FindFullPathFromXml("PathDrawing")); if (settingsDrawing == null) { settingsDrawing = SettingsDrawing.Default; } this.Parcel = parcel; this.SettingsForm = formSettings; }
public static bool IsProjectUnitsFeet() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 SettingsRoot settings = CivilApplication.ActiveDocument.Settings; SettingsDrawing drawingSettings = settings.DrawingSettings; SettingsUnitZone unitZone = drawingSettings.UnitZoneSettings; if ((int)unitZone.DrawingUnits == 30) { return(true); } return(false); }