Can you please help me to Create the Top Level assembly from scratch and Add some existing Assemblies into it in VB/C# code.
This is the senario.
1]Planning to create Top Level form Scracth name is "ABC.asm"
2]Planning to Add Two subAsscembly(XYZ.asm,PQR.asm) into Top Level assembly "ABC.asm"
Please help me.
Thanks & Regards,
Posted by: K Chaudhari
Post date: 4/24/2013 10:12:27 AM
You find a complete solution to your 2 questions in the Programmer's Guide -> Assembly Environment -> Working with Occurrences.
Posted by: Wolfgang Kunert
Post date: 4/25/2013 6:01:21 AM
While reading the section Wolfgang suggested, here are a few hints to help out:
When you get to the part on "Manipulating Occurrences" instead of just settling for .Move() and .Rotate(), look into .GetTransform() and .PutTransform(). These will help you a great deal. .GetTransform() will tell you the current position and rotation of the part/assembly and .PutTransform() will allow you to specify the position and rotation.
Keep in mind that SE uses metric internally, so if you use standard, you will need to convert the value just before feeding it into these functions and after retrieving it from the functions. If you are converting, keep in mind the rounding error and make sure you round to a sane value when you use .GetTransform(). Otherwise you can run into failures since 0.0000000000000001 and 0 are not the same thing. This would happen more in part features and assembly mates than with grounded positioning but still a good habit to get into.
When creating parts and assemblies, make sure you keep the origin in an appropriate place. This will make it much easier to figure out how to position the part when you insert it into the next level assembly.
If you are going to manipulate the part/assembly through the variables table, create a VAR for each DIM you want to edit. Set the DIM equal to the VAR and edit the VAR. Otherwise you will get failures.
Have fun automating, the sky is the limit.
Posted by: Terry Tyson
Post date: 4/25/2013 7:32:08 AM