Yeah ! It's working, here is the code:
Sub CATMain()
On error resume next
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selPN, selGL As Selection
Set selPN = productDocument1.Selection
Set selGL = productDocument1.Selection
Dim Producttemp As Product
Set...
You're right, the file path is different, but I changed it while copying the macro on my Unix station. (/Myserver/myfolder/test.txt)
Actually the code is stopping at the next line:
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Here I am again!
I finally managed to do what I wanted, it's working on my windows PC. But it's giving me the an error on my UNIX station, without any description of the error:
Sub CATMain()
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim selPN, selGL As...
Thanks Fernando, I'm getting closer and closer :)
One last issue: I don't know how to add a selection to another selection. In the code you provided, the selection selPN is changing at each loop of the "For Each strLine in arrLines". But how can I store this information and add it to another...
It looks like it's related to the name I am using. I tried a short sequence of the code above, and I can't make this line works: Set Product2Dot1 = Product3Products.Item("XXX")
Sub CATMain()
Set ActiveProductDocument = CATIA.ActiveDocument
Set Product1 = ActiveProductDocument.Product
Set...
Ok, I worked on this and thanks to your code and this website http://v5vb.wordpress.com/2010/02/08/file-dialogs/#more-224 I found how to read a txt file. I tried mixing your code with the other one, but I still have an issue:
Sub CATMain()
Dim strFilePath As String
Dim objFile As File
Dim...
Thanks for your answers!
It looks like it's a bit more complicated. Indeed I use Catia on a UNIX station, so I would probably not be able to use this Excel sheet... Do you think I can instead use a txt file ?
I tried anyway to launch the macro, it stopped on the Line 29, column 6: "Next i"...
Hi,
I have a CATProduct open (500 parts), I have an Excel file that give me the name of 35 specific parts of this CATProduct. I would like a macro that could create a group with these 35 parts.
I have digged into the search options, I am thinking that a solution could be with personalized...