private void InternalSetPosition(double x, double y, double z) { Inventor.Point newLocation = InventorPersistenceManager.InventorApplication.TransientGeometry.CreatePoint(x, y, z); AssemblyWorkPointDef wpDef = (AssemblyWorkPointDef)InternalWorkPoint.Definition; wpDef.Point = newLocation; }
private InvWorkPoint(Point point, IObjectBinder binder) { this.point = point; this.binder = binder; if (binder.DocumentManager.ActiveAssemblyDoc != null) { this.binder.ContextManager.BindingContextManager = binder.DocumentManager.ActiveAssemblyDoc.ReferenceKeyManager; } else if (binder.DocumentManager.ActivePartDoc != null) { this.binder.ContextManager.BindingContextManager = binder.DocumentManager.ActivePartDoc.ReferenceKeyManager; } this.binder.ContextManager.BindingContextManager = binder.DocumentManager.ActiveAssemblyDoc.ReferenceKeyManager; Inventor.WorkPoint wp; if (this.binder.GetObjectFromTrace <Inventor.WorkPoint>(out wp)) { InternalWorkPoint = wp; AssemblyWorkPointDef wpDef = (AssemblyWorkPointDef)wp.Definition; wpDef.Point = point.ToPoint(); } else { wp = binder.DocumentManager.ActiveAssemblyDoc.ComponentDefinition.WorkPoints.AddFixed(point.ToPoint(), false); InternalWorkPoint = wp; this.binder.SetObjectForTrace <InvWorkPoint>(this.InternalWorkPoint); } }
private InvWorkPoint(Point point, IObjectBinder binder) { _binder = binder; Inventor.WorkPoint wp; if (_binder.GetObjectFromTrace <Inventor.WorkPoint>(out wp)) { InternalWorkPoint = wp; AssemblyWorkPointDef wpDef = (AssemblyWorkPointDef)wp.Definition; wpDef.Point = point.ToPoint(); } else { wp = PersistenceManager.ActiveAssemblyDoc.ComponentDefinition.WorkPoints.AddFixed(point.ToPoint(), false); InternalWorkPoint = wp; _binder.SetObjectForTrace <WorkPoint>(this.InternalWorkPoint); } }