public FlatBody(FlatPattern flatPattern) { this.flatPattern = flatPattern; if (flatPattern.IsDetectingIntersections) { this.flatPart = Part.Create(flatPattern.FlatPart.Document, "Flat Part"); Debug.Assert(flatPart != null, "flatPart != null"); Component flatComponent = Component.Create(flatPattern.FlatPart, flatPart); Debug.Assert(flatComponent != null, "flatComponent != null"); } else { Part mainPart = Window.ActiveWindow.ActiveContext.Context as Part; this.flatPart = flatPattern.FlatPart; } }
////////////////////////////////////////////////////////////////////////////////////// // Use: AdnGraphicsData constructor for FlatPattern graphics // ////////////////////////////////////////////////////////////////////////////////////// public AdnGraphics(FlatPattern flat, string clientId, bool transacting) { _clientId = clientId + (transacting ? "-Tx" : "-NonTx"); _graphicsData = null; _graphics = null; try { _graphicsData = flat.GraphicsDataSetsCollection[_clientId]; } catch { if (transacting) { _graphicsData = flat.GraphicsDataSetsCollection.Add(_clientId); } else { _graphicsData = flat.GraphicsDataSetsCollection.AddNonTransacting(_clientId); } } try { _graphics = flat.ClientGraphicsCollection[_clientId]; } catch { if (transacting) { _graphics = flat.ClientGraphicsCollection.Add(_clientId); } else { _graphics = flat.ClientGraphicsCollection.AddNonTransacting(_clientId); } } }
////////////////////////////////////////////////////////////////////////////////////// // Use: AdnGraphicsData constructor for FlatPattern graphics // ////////////////////////////////////////////////////////////////////////////////////// public AdnGraphics(FlatPattern flat, string clientId, bool transacting) { _clientId = clientId + (transacting ? "-Tx" : "-NonTx"); _graphicsData = null; _graphics = null; try { _graphicsData = flat.GraphicsDataSetsCollection[_clientId]; } catch { if (transacting) { _graphicsData = flat.GraphicsDataSetsCollection.Add(_clientId); } else { _graphicsData = flat.GraphicsDataSetsCollection.AddNonTransacting(_clientId); } } try { _graphics = flat.ClientGraphicsCollection[_clientId]; } catch { if (transacting) { _graphics = flat.ClientGraphicsCollection.Add(_clientId); } else { _graphics = flat.ClientGraphicsCollection.AddNonTransacting(_clientId); } } }
public void SetGraphicsSource(FlatPattern flatPattern) { _workingFlat = flatPattern; _mode = AdnGraphicModeEnum.kFlatPatternGraphics; }
public void SetGraphicsSource(FlatPattern flatPattern) { _workingFlat = flatPattern; _mode = AdnGraphicModeEnum.kFlatPatternGraphics; }