コード例 #1
0
        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());
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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());
        }
コード例 #4
0
ファイル: SiteLocation.cs プロジェクト: whztt07/Dynamo
        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();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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");
        }