- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone. I'm currently creating an assembly generator form that will create new part components based off part templates. The first tab of the form the user has to enter in the new part component part numbers, which writes to specific user parameters. I then have a rule that will create the new part components but I'm stuck on trying to ensure that when it creates these new parts, it uses the value from the user parameter to create the filename of the new part components.
User enters new part numbers for the new left and right channel parts....
Those values get written to these user parameters....
Then the user clicks to run internal rules named "Create Left Channel" and "Create Right Chanel"...
This is the part where I start hitting a wall. Below is the Create Left Channel rule. I have two issues with it. The first is that it's automatically grounding the first channel it creates despite having that option turned off in the Application Options. I copied that code from another thread and I'm not sure what aspect of the code is causing the grounding but I don't want the parts grounded as I have another rule that will position the new channel part components. The second issue I have is how do I make it so that when it creates the new parts, it doesn't name them generic "Part1, Part 2 etc but rather uses the value of the "Left_channel_part_number" user parameter?
Dim oTemplateLeftChannel As String = "C:\_VaultWorkspace\Designs\ETO\Templates\Generators\AVR\AVR Base Generator (Left Double Channel Design).ipt" Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oDocumentDefinition As AssemblyComponentDefinition = oDoc.ComponentDefinition Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oMatrix As Matrix = oTG.CreateMatrix Dim pDoc As PartDocument = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, oTemplateLeftChannel, False) oDocumentDefinition.Occurrences.AddByComponentDefinition(pDoc.ComponentDefinition, oMatrix)
Lastly, once they are done working in the generator form and ready to save the assembly, how do i ensure that the new part components files are saved in a specific folder location? The code for creating the channels I posted above does not seem to give you the option to even save the part files. I need the new part components files saved into "C:\_VaultWorkspace\Designs\ETO\Components\PS501" folder.
Any help would be greatly appreciated!
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!
Solved! Go to Solution.