private static ElementCurveReference TryGetCurveReference(Revit.Elements.Element curveObject, string nodeTypeString = "This node")
        {
            var cs = curveObject.InternalGeometry().OfType<Autodesk.Revit.DB.Curve>();
            if (cs.Any()) return new ElementCurveReference(cs.First());

            throw new ArgumentException(nodeTypeString + " requires a ElementCurveReference extracted from a Revit Element! " +
                             "You supplied an " + curveObject.ToString() + ", but we could not extract a CurveReference from it!");
        }
示例#2
0
        internal WatchViewModel ProcessThing(Element element, string tag, bool showRawData = true)
        {
            var id = element.Id;

            var node = new WatchViewModel(element.ToString(dynSettings.Controller.PreferenceSettings.NumberFormat, CultureInfo.InvariantCulture), tag);
            node.Clicked += () => DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
            node.Link = id.ToString(CultureInfo.InvariantCulture);

            return node;
        }
示例#3
0
        internal WatchViewModel ProcessThing(Element element, string tag, bool showRawData = true)
        {
            var id = element.Id;

            var node = new WatchViewModel(element.ToString(dynSettings.Controller.PreferenceSettings.NumberFormat, CultureInfo.InvariantCulture), tag);

            node.Clicked += () => DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
            node.Link     = id.ToString(CultureInfo.InvariantCulture);

            return(node);
        }
示例#4
0
        internal WatchViewModel ProcessThing(Element element, string tag, bool showRawData)
        {
            var id = element.Id;

            var node = new WatchViewModel(visualizationManager, 
                element.ToString(preferences.NumberFormat, CultureInfo.InvariantCulture), tag);

            node.Clicked += () =>
            {
                if (element.InternalElement.IsValidObject)
                    DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
            };
            node.Link = id.ToString(CultureInfo.InvariantCulture);

            return node;
        }
示例#5
0
        internal WatchViewModel ProcessThing(Element element, string tag, bool showRawData)
        {
            var id = element.Id;

            var node = new WatchViewModel(visualizationManager,
                                          element.ToString(preferences.NumberFormat, CultureInfo.InvariantCulture), tag);

            node.Clicked += () =>
            {
                if (element.InternalElement.IsValidObject)
                {
                    DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
                }
            };
            node.Link = id.ToString(CultureInfo.InvariantCulture);

            return(node);
        }
        private WatchViewModel ProcessThing(Element element, ProtoCore.RuntimeCore runtimeCore, string tag, bool showRawData, WatchHandlerCallback callback)
        {
            var id = element.Id;

            var node = new WatchViewModel(element.ToString(preferences.NumberFormat, CultureInfo.InvariantCulture), tag, RequestSelectGeometry);

            node.Clicked += () =>
            {
                if (element.InternalElement.IsValidObject)
                {
                    DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
                }
            };

            node.Link = id.ToString(CultureInfo.InvariantCulture);

            return(node);
        }
示例#7
0
        internal WatchViewModel ProcessThing(Element element, string tag, bool showRawData = true)
        {
            var id = element.Id;

            // Do not process element for watch which have been removed
            // from the Revit database.
            if (!element.InternalElement.IsValidObject)
            {
                return null;
            }

            var elementString =
                element.ToString(
                    dynSettings.Controller.PreferenceSettings.NumberFormat,
                    CultureInfo.InvariantCulture);

            var node = new WatchViewModel(elementString, tag);
            node.Clicked += () => DocumentManager.Instance.CurrentUIDocument.ShowElements(element.InternalElement);
            node.Link = id.ToString(CultureInfo.InvariantCulture);

            return node;
        }