private object InternClear() { IEnumerator enumerator = default(IEnumerator); AcadTableRecord dobjAcadTableRecord4; try { enumerator = mcolClass.Values.GetEnumerator(); while (enumerator.MoveNext()) { dobjAcadTableRecord4 = (AcadTableRecord)enumerator.Current; mcolClass.Remove("K" + Conversions.ToString(dobjAcadTableRecord4.TableIndex)); AcadObject robjAcadObject = dobjAcadTableRecord4; hwpDxf_AcadObject.BkAcadObject_Quit(ref robjAcadObject); dobjAcadTableRecord4 = (AcadTableRecord)robjAcadObject; dobjAcadTableRecord4 = null; } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } mlngTableIndex = -1; dobjAcadTableRecord4 = null; object InternClear = default(object); return(InternClear); }
internal AcadObject FriendAdd(string vstrName, double vdblObjectID, ref AcadObject robjAcadObject) { hwpDxf_AcadObject.BkAcadObject_LetNodeParentID(ref robjAcadObject, base.NodeID); hwpDxf_AcadObject.BkAcadObject_LetApplicationIndex(ref robjAcadObject, base.FriendGetApplicationIndex); hwpDxf_AcadObject.BkAcadObject_LetDocumentIndex(ref robjAcadObject, base.FriendGetDocumentIndex); hwpDxf_AcadObject.BkAcadObject_LetDatabaseIndex(ref robjAcadObject, base.FriendGetDatabaseIndex); hwpDxf_AcadObject.BkAcadObject_LetOwnerID(ref robjAcadObject, base.ObjectID); string dstrErrMsg = default(string); bool dblnValid = default(bool); if (hwpDxf_AcadObject.BkAcadObject_SetObjectID(ref robjAcadObject, vdblObjectID, ref dstrErrMsg)) { dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint("Dictionary FriendAdd: " + robjAcadObject.ObjectName + ": " + dstrErrMsg); } if (dblnValid && FriendAddItem(vstrName, robjAcadObject)) { return(robjAcadObject); } AcadObject FriendAdd = default(AcadObject); return(FriendAdd); }
internal bool FriendAddItem(string vstrName, AcadObject vobjAcadObject) { string dstrName = Strings.UCase(vstrName); bool FriendAddItem2 = default(bool); if (!mobjDictNames.ContainsKey(dstrName)) { try { mcolClass.Add(vstrName, vobjAcadObject); } catch (Exception ex2) { ProjectData.SetProjectError(ex2); Exception ex = ex2; hwpDxf_AcadObject.BkAcadObject_Quit(ref vobjAcadObject); FriendAddItem2 = false; ProjectData.ClearProjectError(); return(FriendAddItem2); } mobjDictNames.Add(dstrName, vobjAcadObject.ObjectID); mobjDictKeyword.Add("K" + Conversions.ToString(vobjAcadObject.ObjectID), vstrName); return(true); } return(FriendAddItem2); }
internal AcadPlaceholder FriendAddAcadObjectPlaceholderNormal(double nvdblObjectID = -1.0, ref string nrstrErrMsg = "") { if (Operators.CompareString(base.Name, "ACAD_PLOTSTYLENAME", TextCompare: false) == 0) { if (mobjAcadPlaceholderNormal == null) { string dstrPlaceholderName = "Normal"; AcadPlaceholder dobjAcadPlaceholderNormal2 = (AcadPlaceholder)FriendGetItem(dstrPlaceholderName); bool dblnValid = default(bool); if (dobjAcadPlaceholderNormal2 != null) { dblnValid = true; } else { base.Database.Classes.FriendAddAcDbPlaceholder(); dobjAcadPlaceholderNormal2 = new AcadPlaceholder(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadPlaceholder acadPlaceholder = dobjAcadPlaceholderNormal2; acadPlaceholder.FriendLetName = dstrPlaceholderName; acadPlaceholder.FriendLetNodeParentID = base.NodeID; acadPlaceholder.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadPlaceholder.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadPlaceholder.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadPlaceholder.FriendLetOwnerID = base.ObjectID; AcadPlaceholder acadPlaceholder2 = acadPlaceholder; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadPlaceholderNormal2; bool flag = acadPlaceholder2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadPlaceholderNormal2 = (AcadPlaceholder)nrobjAcadObject; if (flag) { acadPlaceholder.FriendAddReactorsID(base.ObjectID, 330); dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadPlaceholder.ObjectName + ": " + nrstrErrMsg); } acadPlaceholder = null; } if (dblnValid) { mobjAcadPlaceholderNormal = dobjAcadPlaceholderNormal2; FriendAddItem(mobjAcadPlaceholderNormal.Name, mobjAcadPlaceholderNormal); FriendLetDefaultID = mobjAcadPlaceholderNormal.ObjectID; } } return(mobjAcadPlaceholderNormal); } AcadPlaceholder FriendAddAcadObjectPlaceholderNormal = default(AcadPlaceholder); return(FriendAddAcadObjectPlaceholderNormal); }
internal Acad3DVertex FriendAppendVertex(double vdblObjectID, object vvar3DVertex, ref string nrstrErrMsg) { object[] dadecCoordinate = new object[3]; double[] dadblCoordinate = new double[3]; nrstrErrMsg = null; bool flag = false; dadblCoordinate[0] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1] { 0 }, null)); dadblCoordinate[1] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1] { 1 }, null)); dadblCoordinate[2] = Conversions.ToDouble(NewLateBinding.LateIndexGet(vvar3DVertex, new object[1] { 2 }, null)); Acad3DVertex dobjAcad3DVertex3 = new Acad3DVertex(); Acad3DVertex acad3DVertex = dobjAcad3DVertex3; acad3DVertex.FriendLetCoordinate = RuntimeHelpers.GetObjectValue(Interaction.IIf(Expression: false, dadecCoordinate, dadblCoordinate)); acad3DVertex.FriendLetNodeParentID = base.NodeID; acad3DVertex.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acad3DVertex.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acad3DVertex.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acad3DVertex.FriendLetOwnerID = base.ObjectID; Acad3DVertex acad3DVertex2 = acad3DVertex; AcadObject nrobjAcadObject = dobjAcad3DVertex3; bool flag2 = acad3DVertex2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcad3DVertex3 = (Acad3DVertex)nrobjAcadObject; if (flag2) { bool dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acad3DVertex.ObjectName + ": " + nrstrErrMsg); } acad3DVertex = null; mobjDictVertices.Add("K" + Conversions.ToString(mobjDictVertices.Count), dobjAcad3DVertex3); if (checked (mobjDictVertices.Count - 1) == 0) { base.FriendLetStartPoint = RuntimeHelpers.GetObjectValue(dobjAcad3DVertex3.Coordinate); } base.FriendLetEndPoint = RuntimeHelpers.GetObjectValue(dobjAcad3DVertex3.Coordinate); InternCalcSize(); Acad3DVertex FriendAppendVertex = dobjAcad3DVertex3; dobjAcad3DVertex3 = null; return(FriendAppendVertex); }
public string GetName(AcadObject vobjObject) { double ddblObjectID = vobjObject.ObjectID; if (!mobjDictKeyword.ContainsKey("K" + Conversions.ToString(ddblObjectID))) { Information.Err().Raise(50000, "AcadDictionary", "Element existiert nicht."); string GetName = default(string); return(GetName); } return(Conversions.ToString(mobjDictKeyword["K" + Conversions.ToString(ddblObjectID)])); }
internal AcadVXTableRecord FriendAddAcadObject(string vstrName, ref string nrstrErrMsg = "") { AcadVXTableRecord dobjAcadVXTableRecord4 = new AcadVXTableRecord(); AcadVXTableRecord acadVXTableRecord = dobjAcadVXTableRecord4; acadVXTableRecord.FriendLetName = vstrName; acadVXTableRecord.FriendLetNodeParentID = base.NodeID; acadVXTableRecord.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadVXTableRecord.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadVXTableRecord.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadVXTableRecord.FriendLetOwnerID = base.ObjectID; AcadVXTableRecord acadVXTableRecord2 = acadVXTableRecord; double friendGetNextObjectID = base.Database.FriendGetNextObjectID; AcadObject nrobjAcadObject = dobjAcadVXTableRecord4; bool flag = acadVXTableRecord2.FriendSetObjectID(friendGetNextObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadVXTableRecord4 = (AcadVXTableRecord)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadVXTableRecord.ObjectName + ": " + nrstrErrMsg); } acadVXTableRecord = null; AcadVXTableRecord FriendAddAcadObject = default(AcadVXTableRecord); if (dblnValid) { try { mcolClass.Add(vstrName, dobjAcadVXTableRecord4); } catch (Exception ex2) { ProjectData.SetProjectError(ex2); Exception ex = ex2; dobjAcadVXTableRecord4.FriendQuit(); dobjAcadVXTableRecord4 = null; Information.Err().Raise(50000, "AcadVXTable", "Element konnte nicht hinzugefügt werden."); ProjectData.ClearProjectError(); return(FriendAddAcadObject); } FriendAddAcadObject = dobjAcadVXTableRecord4; } dobjAcadVXTableRecord4 = null; return(FriendAddAcadObject); }
internal AcadObject FriendGetItemByObjectID(double vdblObjectID) { if (mobjDictKeyword.ContainsKey("K" + Conversions.ToString(vdblObjectID))) { string dstrName = Conversions.ToString(mobjDictKeyword["K" + Conversions.ToString(vdblObjectID)]); if (Operators.CompareString(dstrName, null, TextCompare: false) != 0) { return(FriendGetItem(dstrName)); } } AcadObject FriendGetItemByObjectID = default(AcadObject); return(FriendGetItemByObjectID); }
internal bool FriendSetHandle(ref AcadObject robjAcadObject, string vstrHandle, ref string nrstrErrMsg = "") { nrstrErrMsg = null; double ddblNewObjectID = hwpDxf_Functions.BkDXF_HexToDbl(vstrHandle); if (FriendSetObjectID(ddblNewObjectID, ref robjAcadObject, ref nrstrErrMsg)) { return(true); } nrstrErrMsg = "Die Referenz ist ungültig.\n" + nrstrErrMsg; bool FriendSetHandle = default(bool); return(FriendSetHandle); }
internal AcadSequenceEnd FriendAddAcadObjectSequenceEnd(ref string nrstrErrMsg, double nvdblObjectID = -1.0, bool nvblnWithoutObjectID = false) { AcadSequenceEnd dobjAcadSequenceEnd2; if (mobjAcadSequenceEnd == null) { dobjAcadSequenceEnd2 = new AcadSequenceEnd(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadSequenceEnd acadSequenceEnd = dobjAcadSequenceEnd2; acadSequenceEnd.FriendLetNodeParentID = base.NodeID; acadSequenceEnd.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadSequenceEnd.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadSequenceEnd.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadSequenceEnd.FriendLetOwnerID = base.ObjectID; bool dblnValid = default(bool); if (nvblnWithoutObjectID) { dblnValid = true; } else { AcadSequenceEnd acadSequenceEnd2 = acadSequenceEnd; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadSequenceEnd2; bool flag = acadSequenceEnd2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadSequenceEnd2 = (AcadSequenceEnd)nrobjAcadObject; if (flag) { dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadSequenceEnd.ObjectName + ": " + nrstrErrMsg); } } acadSequenceEnd = null; if (dblnValid) { mobjAcadSequenceEnd = dobjAcadSequenceEnd2; } } AcadSequenceEnd FriendAddAcadObjectSequenceEnd = mobjAcadSequenceEnd; dobjAcadSequenceEnd2 = null; return(FriendAddAcadObjectSequenceEnd); }
public void Replace_Renamed(string vstrOldName, AcadObject vobjObject) { AcadObject dobjAcadObject3 = FriendGetItem(vstrOldName); if (dobjAcadObject3 == null) { dobjAcadObject3 = null; Information.Err().Raise(50000, "AcadDictionary", "Element existiert nicht."); } else { FriendRemoveItem(vstrOldName); FriendAddItem(vstrOldName, dobjAcadObject3); dobjAcadObject3 = null; } }
internal AcadViewport FriendAddAcadObject(string vstrName, double nvdblObjectID = -1.0, ref string nrstrErrMsg = "") { AcadViewport dobjAcadViewport4 = new AcadViewport(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadViewport acadViewport = dobjAcadViewport4; acadViewport.Name = vstrName; acadViewport.FriendLetNodeParentID = base.NodeID; acadViewport.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadViewport.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadViewport.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadViewport.FriendOpen(); acadViewport.FriendLetOwnerID = base.ObjectID; AcadViewport acadViewport2 = acadViewport; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadViewport4; bool flag = acadViewport2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadViewport4 = (AcadViewport)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadViewport.ObjectName + ": " + nrstrErrMsg); } acadViewport = null; AcadViewport FriendAddAcadObject = default(AcadViewport); if (dblnValid) { AcadTableRecord robjAcadTableRecord = dobjAcadViewport4; Add(ref robjAcadTableRecord, vstrName); dobjAcadViewport4 = (AcadViewport)robjAcadTableRecord; mlngActiveIndex = dobjAcadViewport4.TableIndex; FriendAddAcadObject = dobjAcadViewport4; } dobjAcadViewport4 = null; return(FriendAddAcadObject); }
internal AcadDictionaryWithDefault FriendAddAcadObjectPlotStyleNames(double nvdblObjectID = -1.0, ref string nrstrErrMsg = "") { AcadDictionaryWithDefault dobjAcadPlotStyleNames3; if (mobjAcadPlotStyleNames == null) { base.Database.Classes.FriendAddAcDbDictionaryWithDefault(); dobjAcadPlotStyleNames3 = new AcadDictionaryWithDefault(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadDictionaryWithDefault acadDictionaryWithDefault = dobjAcadPlotStyleNames3; acadDictionaryWithDefault.Name = "ACAD_PLOTSTYLENAME"; acadDictionaryWithDefault.FriendLetNodeParentID = base.NodeID; acadDictionaryWithDefault.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadDictionaryWithDefault.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadDictionaryWithDefault.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadDictionaryWithDefault.FriendLetOwnerID = base.ObjectID; AcadDictionaryWithDefault acadDictionaryWithDefault2 = acadDictionaryWithDefault; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadPlotStyleNames3; bool flag = acadDictionaryWithDefault2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadPlotStyleNames3 = (AcadDictionaryWithDefault)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { acadDictionaryWithDefault.FriendAddReactorsID(base.ObjectID, 330); dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadDictionaryWithDefault.ObjectName + ": " + nrstrErrMsg); } acadDictionaryWithDefault = null; if (dblnValid) { mobjAcadPlotStyleNames = dobjAcadPlotStyleNames3; FriendAddItem(mobjAcadPlotStyleNames.Name, mobjAcadPlotStyleNames); } } AcadDictionaryWithDefault FriendAddAcadObjectPlotStyleNames = mobjAcadPlotStyleNames; dobjAcadPlotStyleNames3 = null; return(FriendAddAcadObjectPlotStyleNames); }
public AcadObject Remove(string vstrName) { AcadObject dobjAcadObject3 = FriendRemoveItem(vstrName); AcadObject Remove; if (dobjAcadObject3 == null) { dobjAcadObject3 = null; Remove = null; Information.Err().Raise(50000, "AcadDictionary", "Element existiert nicht."); } else { Remove = dobjAcadObject3; dobjAcadObject3 = null; } return(Remove); }
public AcadObject Item(object vvarIndex) { AcadObject dobjAcadObject3 = FriendGetItem(RuntimeHelpers.GetObjectValue(vvarIndex)); AcadObject Item; if (dobjAcadObject3 == null) { dobjAcadObject3 = null; Item = null; Information.Err().Raise(50000, "AcadDictionary", "Element existiert nicht."); } else { Item = dobjAcadObject3; dobjAcadObject3 = null; } return(Item); }
public AcadObject GetObject_Renamed(string vstrName) { AcadObject dobjAcadObject3 = FriendGetItem(vstrName); AcadObject GetObject_Renamed; if (dobjAcadObject3 == null) { dobjAcadObject3 = null; GetObject_Renamed = null; Information.Err().Raise(50000, "AcadDictionary", "Element existiert nicht."); } else { GetObject_Renamed = dobjAcadObject3; dobjAcadObject3 = null; } return(GetObject_Renamed); }
internal AcadLayouts FriendAddAcadObjectLayouts(double nvdblObjectID = -1.0, ref string nrstrErrMsg = "") { AcadLayouts dobjAcadLayouts3; if (mobjAcadLayouts == null) { dobjAcadLayouts3 = new AcadLayouts(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadLayouts acadLayouts = dobjAcadLayouts3; acadLayouts.FriendLetNodeParentID = base.NodeID; acadLayouts.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadLayouts.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadLayouts.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadLayouts.FriendLetOwnerID = base.ObjectID; AcadLayouts acadLayouts2 = acadLayouts; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadLayouts3; bool flag = acadLayouts2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadLayouts3 = (AcadLayouts)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { acadLayouts.FriendAddReactorsID(base.ObjectID, 330); dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadLayouts.ObjectName + ": " + nrstrErrMsg); } acadLayouts = null; if (dblnValid) { mobjAcadLayouts = dobjAcadLayouts3; FriendAddItem(mobjAcadLayouts.Name, mobjAcadLayouts); } } AcadLayouts FriendAddAcadObjectLayouts = mobjAcadLayouts; dobjAcadLayouts3 = null; return(FriendAddAcadObjectLayouts); }
internal new void FriendQuit() { if (!mblnOpened) { return; } if (mobjAcadXData != null) { mobjAcadXData.FriendQuit(); } if (mdblObjectID > 0.0 && mlngDatabaseIndex > -1) { if (hwpDxf_Vars.pobjAcadDatabases.Opened) { AcadDatabase dobjAcadDatabase = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex); if (dobjAcadDatabase != null) { double vdblObjectID = mdblObjectID; string nrstrErrMsg = ""; AcadObject dobjAcadObject = default(AcadObject); if (dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID, ref dobjAcadObject, ref nrstrErrMsg) && Operators.CompareString(mstrObjectName, dobjAcadObject.ObjectName, TextCompare: false) == 0) { dobjAcadDatabase.FriendRemoveObjectID(mdblObjectID); } } else { hwpDxf_Functions.BkDXF_DebugPrint("AcadObject, FriendQuit 2, Keine Datenbank: " + mstrObjectName); } } else { hwpDxf_Functions.BkDXF_DebugPrint("AcadObject, FriendQuit 1, Keine Datenbanken: " + mstrObjectName); } } base.FriendQuit(); mdblObjectID = -1.0; mdblOwnerID = -1.0; mobjAcadXData = null; mobjDictReactors = null; mobjDictXDictionary = null; mblnOpened = false; }
internal AcadMaterial FriendAddAcadObject(string vstrName, double nvdblObjectID = -1.0, ref string nrstrErrMsg = "") { AcadMaterial dobjAcadMaterial3 = new AcadMaterial(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadMaterial acadMaterial = dobjAcadMaterial3; acadMaterial.Name = vstrName; acadMaterial.FriendLetNodeParentID = base.NodeID; acadMaterial.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadMaterial.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadMaterial.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadMaterial.FriendLetOwnerID = base.ObjectID; AcadMaterial acadMaterial2 = acadMaterial; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadMaterial3; bool flag = acadMaterial2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadMaterial3 = (AcadMaterial)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadMaterial.ObjectName + ": " + nrstrErrMsg); } acadMaterial = null; AcadMaterial FriendAddAcadObject = default(AcadMaterial); if (dblnValid && FriendAddItem(vstrName, dobjAcadMaterial3)) { FriendAddAcadObject = dobjAcadMaterial3; } dobjAcadMaterial3 = null; return(FriendAddAcadObject); }
internal AcadTableRecord FriendGetItemByObjectID(double vdblObjectID) { AcadTableRecord FriendGetItemByObjectID = default(AcadTableRecord); AcadTableRecord dobjAcadTableRecord3 = default(AcadTableRecord); if (mobjDictObjectID.ContainsKey("K" + Conversions.ToString(vdblObjectID))) { AcadDatabase database = base.Database; AcadObject robjAcadObject = dobjAcadTableRecord3; string nrstrErrMsg = ""; bool flag = database.FriendObjectIdToObject(vdblObjectID, ref robjAcadObject, ref nrstrErrMsg); dobjAcadTableRecord3 = (AcadTableRecord)robjAcadObject; if (flag) { FriendGetItemByObjectID = dobjAcadTableRecord3; } } dobjAcadTableRecord3 = null; return(FriendGetItemByObjectID); }
internal new void FriendQuit() { AcadXline dobjAcadXline2 = default(AcadXline); AcadDatabase dobjAcadDatabase2; if (mblnOpened) { if (mobjDictEntities.Count > 0) { dobjAcadDatabase2 = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex); if (dobjAcadDatabase2 != null) { object dvarObjectIDs = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values)); int num = Information.LBound((Array)dvarObjectIDs); int num2 = Information.UBound((Array)dvarObjectIDs); for (int dlngIdx = num; dlngIdx <= num2; dlngIdx = checked (dlngIdx + 1)) { AcadDatabase acadDatabase = dobjAcadDatabase2; double vdblObjectID = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarObjectIDs, new object[1] { dlngIdx }, null)); AcadObject robjAcadObject = dobjAcadXline2; string nrstrErrMsg = ""; bool flag = acadDatabase.FriendObjectIdToObject(vdblObjectID, ref robjAcadObject, ref nrstrErrMsg); dobjAcadXline2 = (AcadXline)robjAcadObject; if (flag) { dobjAcadXline2.FriendQuit(); dobjAcadXline2 = null; } } } } base.FriendQuit(); mobjDictEntities = null; mblnOpened = false; } dobjAcadXline2 = null; dobjAcadDatabase2 = null; }
internal AcadObject FriendGetItem(object vvarIndex) { AcadObject FriendGetItem = default(AcadObject); if (Information.VarType(RuntimeHelpers.GetObjectValue(vvarIndex)) == VariantType.String && mobjDictNames.ContainsKey(Strings.UCase(Conversions.ToString(vvarIndex)))) { try { FriendGetItem = (AcadObject)mcolClass[Conversions.ToString(vvarIndex)]; return(FriendGetItem); } catch (Exception ex2) { ProjectData.SetProjectError(ex2); Exception ex = ex2; ProjectData.ClearProjectError(); return(FriendGetItem); } } return(FriendGetItem); }
internal AcadObject FriendRemoveItem(object vvarIndex) { AcadObject dobjAcadObject2 = FriendGetItem(RuntimeHelpers.GetObjectValue(vvarIndex)); AcadObject FriendRemoveItem; if (dobjAcadObject2 == null) { FriendRemoveItem = null; } else { string dstrName = Conversions.ToString(mobjDictKeyword["K" + Conversions.ToString(dobjAcadObject2.ObjectID)]); mcolClass.Remove(RuntimeHelpers.GetObjectValue(vvarIndex)); mobjDictNames.Remove(Strings.UCase(dstrName)); mobjDictKeyword.Remove("K" + Conversions.ToString(dobjAcadObject2.ObjectID)); hwpDxf_AcadObject.BkAcadObject_Quit(ref dobjAcadObject2); FriendRemoveItem = dobjAcadObject2; } dobjAcadObject2 = null; return(FriendRemoveItem); }
internal bool FriendSetObjectID(double vdblObjectID, ref AcadObject nrobjAcadObject = null, ref string nrstrErrMsg = "") { nrstrErrMsg = null; AcadDatabase dobjAcadDatabase = Database; if (mdblObjectID == vdblObjectID) { return(true); } if (Operators.CompareString(mstrObjectName, nrobjAcadObject.ObjectName, TextCompare: false) != 0) { mdblObjectID = vdblObjectID; return(true); } if (mdblObjectID != -1.0 || vdblObjectID <= -1.0) { nrstrErrMsg = "Die Object-ID darf nicht geändert werden."; hwpDxf_Functions.BkDXF_DebugPrint(mstrObjectName + ": " + nrstrErrMsg); } else { if (dobjAcadDatabase.FriendValidObjectID(vdblObjectID, ref nrstrErrMsg)) { AcadObject robjAcadObject = (AcadObject)Interaction.IIf(nrobjAcadObject == null, this, nrobjAcadObject); dobjAcadDatabase.FriendAddObjectID(vdblObjectID, ref robjAcadObject); mdblObjectID = vdblObjectID; if (mobjAcadXData != null) { mobjAcadXData.FriendLetOwnerID = mdblObjectID; } return(true); } hwpDxf_Functions.BkDXF_DebugPrint("2 " + mstrObjectName + ": " + nrstrErrMsg + ", " + Versioned.TypeName(nrobjAcadObject) + ", " + nrobjAcadObject.ObjectName); } bool FriendSetObjectID = default(bool); return(FriendSetObjectID); }
internal AcadTableRecord FriendRemoveByObjectID(double vdblObjectID) { AcadTableRecord dobjAcadTableRecord4 = FriendGetItemByObjectID(vdblObjectID); AcadTableRecord FriendRemoveByObjectID = default(AcadTableRecord); if (dobjAcadTableRecord4 != null) { if (!InternRemove(dobjAcadTableRecord4)) { dobjAcadTableRecord4 = null; FriendRemoveByObjectID = null; goto IL_0040; } AcadObject robjAcadObject = dobjAcadTableRecord4; hwpDxf_AcadObject.BkAcadObject_Quit(ref robjAcadObject); dobjAcadTableRecord4 = (AcadTableRecord)robjAcadObject; FriendRemoveByObjectID = dobjAcadTableRecord4; } dobjAcadTableRecord4 = null; goto IL_0040; IL_0040: return(FriendRemoveByObjectID); }
internal AcadDictionary FriendAddAcadObject(string vstrName, double vdblObjectID, ref string nrstrErrMsg = "") { AcadDictionary dobjAcadDictionary3 = new AcadDictionary(); AcadDictionary acadDictionary = dobjAcadDictionary3; acadDictionary.Name = vstrName; acadDictionary.FriendLetNodeParentID = base.NodeID; acadDictionary.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadDictionary.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadDictionary.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadDictionary.FriendLetOwnerID = base.ObjectID; AcadDictionary acadDictionary2 = acadDictionary; AcadObject nrobjAcadObject = dobjAcadDictionary3; bool flag = acadDictionary2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadDictionary3 = (AcadDictionary)nrobjAcadObject; bool dblnValid = default(bool); if (flag) { acadDictionary.FriendAddReactorsID(base.ObjectID, 330); dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadDictionary.ObjectName + ": " + nrstrErrMsg); } acadDictionary = null; AcadDictionary FriendAddAcadObject = default(AcadDictionary); if (dblnValid && FriendAddItem(vstrName, dobjAcadDictionary3)) { FriendAddAcadObject = dobjAcadDictionary3; } dobjAcadDictionary3 = null; return(FriendAddAcadObject); }
internal AcadFaceRecord FriendAppendFace(double vdblObjectID, int vlngVertex1, int vlngVertex2, int vlngVertex3, int vlngVertex4, ref string nrstrErrMsg = "") { object[] dadecCoordinate = new object[3]; double[] dadblCoordinate = new double[3]; nrstrErrMsg = null; AcadFaceRecord dobjAcadFaceRecord3 = new AcadFaceRecord(); AcadFaceRecord acadFaceRecord = dobjAcadFaceRecord3; acadFaceRecord.FriendLetVertex1 = vlngVertex1; acadFaceRecord.FriendLetVertex2 = vlngVertex2; acadFaceRecord.FriendLetVertex3 = vlngVertex3; acadFaceRecord.FriendLetVertex4 = vlngVertex4; acadFaceRecord.FriendLetNodeParentID = base.NodeID; acadFaceRecord.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadFaceRecord.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadFaceRecord.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadFaceRecord.FriendLetOwnerID = base.ObjectID; AcadFaceRecord acadFaceRecord2 = acadFaceRecord; AcadObject nrobjAcadObject = dobjAcadFaceRecord3; bool flag = acadFaceRecord2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadFaceRecord3 = (AcadFaceRecord)nrobjAcadObject; if (flag) { bool dblnValid = true; } else { hwpDxf_Functions.BkDXF_DebugPrint(acadFaceRecord.ObjectName + ": " + nrstrErrMsg); } acadFaceRecord = null; mobjDictFaceRecords.Add("K" + Conversions.ToString(mobjDictFaceRecords.Count), dobjAcadFaceRecord3); AcadFaceRecord FriendAppendFace = dobjAcadFaceRecord3; dobjAcadFaceRecord3 = null; return(FriendAppendFace); }
public AcadXline Item(object vvarValue) { if (mobjDictEntities.Count > 0) { AcadDatabase dobjAcadDatabase = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex); if (dobjAcadDatabase != null) { AcadXline dobjAcadXline4 = default(AcadXline); switch (Information.VarType(RuntimeHelpers.GetObjectValue(vvarValue))) { case VariantType.Double: { double ddblObjectID2 = Conversions.ToDouble(vvarValue); if (mobjDictEntities.ContainsKey("K" + Conversions.ToString(ddblObjectID2))) { double ddblCurObjectID2 = Conversions.ToDouble(mobjDictEntities["K" + Conversions.ToString(ddblObjectID2)]); double vdblObjectID3 = ddblCurObjectID2; AcadObject robjAcadObject = dobjAcadXline4; string nrstrErrMsg = ""; bool flag = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID3, ref robjAcadObject, ref nrstrErrMsg); dobjAcadXline4 = (AcadXline)robjAcadObject; if (flag) { return(dobjAcadXline4); } } break; } case VariantType.String: { string vstrHexNum = Conversions.ToString(vvarValue); int nrlngErrNum = 0; string nrstrErrMsg = ""; if (!hwpDxf_Functions.BkDXF_ValidHexNum(vstrHexNum, ref nrlngErrNum, ref nrstrErrMsg)) { break; } double ddblObjectID2 = hwpDxf_Functions.BkDXF_HexToDbl(Conversions.ToString(vvarValue)); if (mobjDictEntities.ContainsKey("K" + Conversions.ToString(ddblObjectID2))) { double ddblCurObjectID2 = Conversions.ToDouble(mobjDictEntities["K" + Conversions.ToString(ddblObjectID2)]); double vdblObjectID2 = ddblCurObjectID2; AcadObject robjAcadObject = dobjAcadXline4; nrstrErrMsg = ""; bool flag = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID2, ref robjAcadObject, ref nrstrErrMsg); dobjAcadXline4 = (AcadXline)robjAcadObject; if (flag) { return(dobjAcadXline4); } } break; } case VariantType.Short: case VariantType.Integer: { int dlngIndex = Conversions.ToInteger(vvarValue); if ((dlngIndex >= 0) & (dlngIndex < mobjDictEntities.Count)) { object dvarObjectIDs = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values)); double vdblObjectID = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarObjectIDs, new object[1] { dlngIndex }, null)); AcadObject robjAcadObject = dobjAcadXline4; string nrstrErrMsg = ""; bool flag = dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID, ref robjAcadObject, ref nrstrErrMsg); dobjAcadXline4 = (AcadXline)robjAcadObject; if (flag) { return(dobjAcadXline4); } } break; } } } } AcadXline Item = default(AcadXline); return(Item); }
internal object FriendGetMinMaxCoords() { object dvarItems = RuntimeHelpers.GetObjectValue(hwpDxf_Functions.BkDXF_ValueCollectionToArray(mobjDictEntities.Values)); int num = Information.LBound((Array)dvarItems); int num2 = Information.UBound((Array)dvarItems); bool dblnFirst = default(bool); object dvarMaxCoordX = default(object); object dvarMaxCoordY = default(object); object dvarMinCoordX = default(object); object dvarMinCoordY = default(object); AcadXline dobjObject = default(AcadXline); for (int dlngIdx = num; dlngIdx <= num2; dlngIdx = checked (dlngIdx + 1)) { double ddblCurObjectID = Conversions.ToDouble(NewLateBinding.LateIndexGet(dvarItems, new object[1] { dlngIdx }, null)); AcadDatabase database = Database; AcadObject robjAcadObject = dobjObject; string nrstrErrMsg = ""; database.FriendObjectIdToObject(ddblCurObjectID, ref robjAcadObject, ref nrstrErrMsg); dobjObject = (AcadXline)robjAcadObject; object dvarMinMaxCoords = RuntimeHelpers.GetObjectValue(dobjObject.MinMaxCoords); if (dvarMinMaxCoords == null) { continue; } if (!dblnFirst) { dvarMaxCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 0 }, null)); dvarMaxCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 1 }, null)); dvarMinCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 2 }, null)); dvarMinCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 3 }, null)); dblnFirst = true; continue; } if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 0 }, null), dvarMaxCoordX, TextCompare: false)) { dvarMaxCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 0 }, null)); } if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 1 }, null), dvarMaxCoordY, TextCompare: false)) { dvarMaxCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 1 }, null)); } if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 2 }, null), dvarMinCoordX, TextCompare: false)) { dvarMinCoordX = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 2 }, null)); } if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 3 }, null), dvarMinCoordY, TextCompare: false)) { dvarMinCoordY = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(dvarMinMaxCoords, new object[1] { 3 }, null)); } } object FriendGetMinMaxCoords = (!dblnFirst) ? null : new object[4] { dvarMaxCoordX, dvarMaxCoordY, dvarMinCoordX, dvarMinCoordY }; dobjObject = null; return(FriendGetMinMaxCoords); }
internal AcadBlock FriendAddAcadObject(ref string nrstrErrMsg, string vstrName, double nvdblObjectID = -1.0) { AcadBlock dobjAcadBlock3 = new AcadBlock(); if (nvdblObjectID == -1.0) { nvdblObjectID = base.Database.FriendGetNextObjectID; } AcadBlock acadBlock = dobjAcadBlock3; acadBlock.Name = vstrName; acadBlock.FriendLetNodeParentID = base.NodeID; acadBlock.FriendLetApplicationIndex = base.FriendGetApplicationIndex; acadBlock.FriendLetDocumentIndex = base.FriendGetDocumentIndex; acadBlock.FriendLetDatabaseIndex = base.FriendGetDatabaseIndex; acadBlock.FriendLetOwnerID = base.ObjectID; AcadBlock acadBlock2 = acadBlock; double vdblObjectID = nvdblObjectID; AcadObject nrobjAcadObject = dobjAcadBlock3; bool flag = acadBlock2.FriendSetObjectID(vdblObjectID, ref nrobjAcadObject, ref nrstrErrMsg); dobjAcadBlock3 = (AcadBlock)nrobjAcadObject; bool dblnValid = default(bool); AcadObject dobjAcadObject5; if (flag) { dblnValid = true; if (!hwpDxf_Vars.pblnReadDocument) { if (dblnValid) { dobjAcadObject5 = acadBlock.FriendAddAcadObjectBlockBegin(ref nrstrErrMsg, -1.0, nvblnWithoutObjectID: false); if (dobjAcadObject5 == null) { dblnValid = false; } dobjAcadObject5 = null; } if (dblnValid) { dobjAcadObject5 = acadBlock.FriendAddAcadObjectBlockEnd(ref nrstrErrMsg, -1.0, nvblnWithoutObjectID: false); if (dobjAcadObject5 == null) { dblnValid = false; } dobjAcadObject5 = null; } if (dblnValid) { acadBlock.FriendNewEntityDictionaries(); } } } else { hwpDxf_Functions.BkDXF_DebugPrint(acadBlock.ObjectName + ": " + nrstrErrMsg); } acadBlock = null; AcadBlock FriendAddAcadObject = default(AcadBlock); if (dblnValid) { AcadTableRecord robjAcadTableRecord = dobjAcadBlock3; Add(ref robjAcadTableRecord, vstrName); dobjAcadBlock3 = (AcadBlock)robjAcadTableRecord; string left = Strings.UCase(vstrName); if (Operators.CompareString(left, Strings.UCase("*Model_Space"), TextCompare: false) == 0) { if (mobjAcadModelSpace == null) { mobjAcadModelSpace = new AcadModelSpace(); mobjAcadModelSpace.FriendInit(ref dobjAcadBlock3); } } else if (Operators.CompareString(left, Strings.UCase("*Paper_Space"), TextCompare: false) == 0) { if (mobjAcadPaperSpace == null) { if (!hwpDxf_Vars.pblnReadDocument) { dobjAcadBlock3.BlockBegin.FriendLetIsPaperSpace = true; dobjAcadBlock3.BlockEnd.FriendLetIsPaperSpace = true; } mobjAcadPaperSpace = new AcadPaperSpace(); mobjAcadPaperSpace.FriendInit(ref dobjAcadBlock3); } } else if (Operators.CompareString(left, Strings.UCase("*Paper_Space0"), TextCompare: false) == 0 && mobjAcadPaperSpace0 == null) { mobjAcadPaperSpace0 = new AcadPaperSpace(); mobjAcadPaperSpace0.FriendInit(ref dobjAcadBlock3); } FriendAddAcadObject = dobjAcadBlock3; } dobjAcadObject5 = null; dobjAcadBlock3 = null; return(FriendAddAcadObject); }