質問

I'm new to Revit Api Programming..I want to make program that user can select any object he has drawn, then he will get the object repeated. the problem is i don't know how to identify object to get its parameters and the point to repeat it ..Any guidelines Please? Thanks In Advance.

役に立ちましたか?

解決

I'll assume you're using a macro for the following answer.

To retrieve a user's current selection:

UIDocument uidoc = this.ActiveUIDocument;
SelElementSet selElSet = uidoc.Selection.Elements;
IEnumerable<Element> elements = (from Element el in selElSet select el);

To prompt a user to select an element:

UIDocument uidoc = this.ActiveUIDocument;
Reference reference = uidoc.Selection.PickObject(ObjectType.Element);
Element el = uidoc.Document.GetElement(reference);

Take a look at the Revit API samples, at the API documentation file (RevitAPI.chm), The Building Coder blog and the Boost Your BIM blog if you want some more information on how to get started.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top