Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I am trying to create a family which displays the spot elevation of the uneven surface, which has been discussed several times in the forum and seems to be insoluble thing. So i decided to create a small macro which prompts me to select the point on a face and displays the XYZ coordinates at the selection.
The problem here is its throwing "Null Reference Exception" dont really understand which object its referring to.Could somebody point where I am doing wrong.
public void selectPoint() { UIDocument uiDoc = this.ActiveUIDocument; Document doc = uiDoc.Document; Reference myRef = uiDoc.Selection.PickObject(ObjectType.PointOnElement); Element e = doc.GetElement(myRef); GeometryObject geomObj = e.GetGeometryObjectFromReference(myRef); Point p = geomObj as Point; TaskDialog.Show("Element Info",e.Name + p.Coord); }
Solved! Go to Solution.