Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create Assembly #13

Closed
Tejal-Alai opened this issue Mar 6, 2024 · 2 comments
Closed

How to create Assembly #13

Tejal-Alai opened this issue Mar 6, 2024 · 2 comments

Comments

@Tejal-Alai
Copy link

I want to create assembly I tried it by 2 ways
1)I have tried to create ArrayList of ModelObjects and then tried to create assembly using Assembly.Add method but its throwing error.

        List<ModelObject> modelObjectsList = new List<ModelObject>();
        Beam beam = new Beam();
        ModelObject modelObject = beam as ModelObject;
        modelObjectsList.Add(modelObject);
        ArrayList arrayListofAssemblables = new ArrayList();
        arrayListofAssemblables.Add(modelObjectsList);
        Assembly assembly = new Assembly();
        assembly.Add(arrayListofAssemblables);
  1. Passing model object to IAssemblable and then pass it to .Add method but its still throwing error that 'Assemblable is not valid'

         Beam beam = new Beam();
         ModelObject modelObject = beam as ModelObject;
         Assembly assembly = new Assembly();
         IAssemblable assemblable = modelObject as IAssemblable;
         assembly.Add(assemblable);
    
@CarlosHerrero
Copy link
Contributor

Internal code of TeklaStructures creates assembly automatically when a part is inserted.
myPart.Insert();
myPart.GetAssembly(); // returns the assembly created by internal code

@Tejal-Alai
Copy link
Author

myPart.Insert();
this is not working for me as i have to do unit testing of my function which takes assembly as input and while unit testing i can not insert functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants