I would like to create a CATIA catalog with various common models of parts and products as well as template products. I would like these template products to act as a New From type process when selected from the catalog. In other words, I have a template product that contains parameter links...
I know there are some previous threads that are similar to this that have been closed but I thought I would post the wonky VBA script I have been using for this that is somewhat hit or miss. It mostly works but sometimes behaves a little strange by de-activating the first child node of some of...
I am fairly confident I have performed the below procedure dozens of times over many years but now it seems to not work the same way I remember.
I have multiple part instances within a product. This part contains a point at 0,0,0 within its own coordinate system. These instances are located...
Here is the testing section I'm using here where it assigns a linked material. I want to be able to find the material link back to source from a node selection. Thanks for the help!
Sub CATMain()
Dim MaterialDocPath As String
Dim MaterialName As String, MaterialFamilyName As String
Dim...
I am trying to develop a routine to capture the materials of selected products within an active product at various node levels and then push these material assignments to the reference product nodes of every part at their parent level. I only have material assignments assigned at the part's...
So it appears it is how it is handling the cutting and pasting of components. If my tree only contains products and parts at the top level of the tree the script works fine. I started down the path of filtering them with a separate paste operation but was wondering if there is a better way to...
I see what you mean. I updated my code above so that it actually works now...I hope. I had botched a copy and paste or something last time. Where did you come up with "CATIAVBSelectionSetsImpl" if you don't mind me asking?
Thanks for the help. The "CATIAVBSelectionSetsImpl" is what I was needing. I revised your code so that what items are selected in the tree get their own selection sets or the option to drop them in a named set which is why I was needing the script. Thanks again.
Sub CATMain()
Dim SelCheck...
I would like to resurrect an old thread related to selection sets and accessing them through VBA. Like the other poster I see the commands in the scripting documentation but I am unaware how to actually use them. Anyone out there care to share? Thanks.
So here is what I have so far. Interestingly, if you step through the code the first Sel2.Paste actually occurs later in the code than right after that paste command. It seems to be pasting during the middle of a For loop but depending on the break points it seems to vary...Still makes...
I see my issue has to do with the infamous blue problem. Because my current code does not perform any commands similar to double clicking on a tree item in order to change focus to that item I am getting duplicated items. Is the send key method still the best option for simulating this mouse...
I appreciate the help and suggestions. So I went ahead and followed Calin's suggestion with the cut and paste however I get a "Copy (1)" for the parts and products at the top level of the tree that are being copied. I am using the selection cut and paste method in the script so I don't know...
Here is a snipit of a larger set of code that seems to do what I want but only if the tree contains CGR's:
For Each component In CATIA.ActiveDocument.Product.Products
If component.HasAMasterShapeRepresentation Then
Set newComp = component.Products.AddNewProduct(component.name &...