public SiteLocation(IEnumerable <PortModel> inPorts, IEnumerable <PortModel> outPorts) : base(inPorts, outPorts) { Location = DynamoUnits.Location.ByLatitudeAndLongitude(0.0, 0.0); Location.Name = string.Empty; ArgumentLacing = LacingStrategy.Disabled; DynamoRevitApp.EventHandlerProxy.DocumentOpened += model_RevitDocumentChanged; RevitServicesUpdater.Instance.ElementsUpdated += RevitServicesUpdater_ElementsUpdated; DynamoRevitApp.AddIdleAction(() => Update()); }
public SiteLocation() { OutPortData.Add(new PortData("Location", Properties.Resources.PortDataLocationToolTip)); RegisterAllPorts(); Location = DynamoUnits.Location.ByLatitudeAndLongitude(0.0, 0.0); ArgumentLacing = LacingStrategy.Disabled; DocumentManager.Instance.CurrentUIApplication.Application.DocumentOpened += model_RevitDocumentChanged; RevitServicesUpdater.Instance.ElementsModified += RevitServicesUpdater_ElementsModified; Update(); }
public SiteLocation() { OutPorts.Add(new PortModel(PortType.Output, this, new PortData("Location", Properties.Resources.PortDataLocationToolTip))); RegisterAllPorts(); Location = DynamoUnits.Location.ByLatitudeAndLongitude(0.0, 0.0); Location.Name = string.Empty; ArgumentLacing = LacingStrategy.Disabled; DynamoRevitApp.EventHandlerProxy.DocumentOpened += model_RevitDocumentChanged; RevitServicesUpdater.Instance.ElementsUpdated += RevitServicesUpdater_ElementsUpdated; DynamoRevitApp.AddIdleAction(() => Update()); }
public SiteLocation(WorkspaceModel workspaceModel) : base(workspaceModel) { OutPortData.Add(new PortData("Location", "The location of the current Revit project.")); RegisterAllPorts(); Location = DynamoUnits.Location.ByLatitudeAndLongitude(0.0, 0.0); ArgumentLacing = LacingStrategy.Disabled; model = (RevitDynamoModel)workspaceModel.DynamoModel; model.RevitDocumentChanged += model_RevitDocumentChanged; model.RevitServicesUpdater.ElementsModified += RevitServicesUpdater_ElementsModified; Update(); }
private void Update() { if (DocumentManager.Instance.CurrentDBDocument.IsFamilyDocument) { Location = null; Warning(Properties.Resources.SiteLocationFamilyDocumentWarning); return; } var location = DocumentManager.Instance.CurrentDBDocument.SiteLocation; Location.Name = location.PlaceName; Location.Latitude = location.Latitude.ToDegrees(); Location.Longitude = location.Longitude.ToDegrees(); OnNodeModified(true); RaisePropertyChanged("Location"); }