Message 1 of 5
Select point from form
Not applicable
05-22-2016
11:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm updating an old add-on. I am trying to place a TextNote at a specific location. It works fine if I supply it an XYZ point. But I cannot get it to work by using Document.Selection.Pickpoint. The code below is called from a separate form. I can't even catch an exception, revit becomes unresponsive. How would I pick a point then pass it to the TextNote.Create method? Thanks.
public void CreateText()
{
RevitView curView = m_revit.ActiveUIDocument.Document.ActiveView;
//XYZ origin = new XYZ(10, 10, 0);
XYZ orgin = m_document.Selection.PickPoint("Pick Note Location");
ElementId defaultTypeId = m_revit.ActiveUIDocument.Document.GetDefaultElementTypeId(ElementTypeGroup.TextNoteType);
TextNote note = TextNote.Create(m_revit.ActiveUIDocument.Document, curView.Id, orgin, "TEXT NOTE", defaultTypeId);
}
