- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have the following workflow and not sure which overload is the best one for the below code:
1. The user should pick an instance from his local model which is already hosted on a face of a linked element.
2. The user should pick a linked element (could be any family wall, furniture, duct etc...)
3. The function should auto-insert the element (1) on all the faces of the same instance (2) at the same relative point.
For example: the user has a lamp placed on a desk at the far left corner, there are multiple instances of this desk in the view, I want the function to auto-insert the lamp on all the desks at the far left corner.
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
var doc = commandData.Application.ActiveUIDocument.Document;
var PromptPickObject = new PromptPickObject(doc);
var localElement = PromptPickObject.GetLocalElement().Element;
var linkedElement = PromptPickObject.GetLinkedElement().Element;
var elFamInst = localElement as FamilyInstance;
using (Transaction trans = new Transaction(doc, "Mass Place Instances"))
{
trans.Start();
//doc.Create.NewFamilyInstance(???, ???? , ???);
trans.Commit();
}
return Result.Succeeded;
}
Could you please help me by pointing me in the right direction, what is the best way in this case?
Solved! Go to Solution.
Developer Advocacy and Support +