Guest User

Untitled

a guest
Oct 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. ```c#
  2. Model Model = new Model();
  3. System.Type[] Types = new System.Type[1];
  4. Types.SetValue(typeof(TSM.Part), 0);
  5.  
  6. ModelObjectEnumerator parts = Model.GetModelObjectSelector().GetAllObjectsWithType(Types);
  7.  
  8. foreach (TSM.Part part in parts)
  9. {
  10. // you can cast the part to an object that you are after e.g. Beam, perhaps depending on some certain properties (e.g. a certain length etc) and add that to a collection accordingly if you wish.
  11. Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Assembly number " + part.AssemblyNumber + " " + part );
  12. }
  13. ```
Add Comment
Please, Sign In to add comment