Hello everybody,
I'm using a macro to extract some characteristics of my parts, especially coordinates.
But I don't understand why the coordinates of the Center of Gravity are in meter in my Excel file while the other are in millimeters.
I built my code in the same way for the different...
Hello MahPLM,
Just to be sure: you're writing this macro inside CATIA or outside on Visual Studio or VBA?
selection1.Search("ElectricalObject")
Are you sure "ElectricalObject" is the real name given by Dassault?
Moreover, I think you should add ,all to be sure you select everything...
Hello!
Why don't you use the search function?
Sub CATMain()
set Sel = CATIA.ActiveDocument.Selection
Sel.Search "Name=BS,all"
End Sub
That way you may find the part with BS in it
Hello, for the document loaded you may use this as inspiration:
Err.Clear
On Error Resume Next
'//---------- Get the active document
Set objGCATIADocument0 = CATIA.ActiveDocument
If Err.Number <> 0 Then
MsgBox "You must have a loaded and active document in the session", _...
If I recall correctly, Teamcenter is a Siemens Product and works with NX unless you buy the bridge software between Catia and Teamcenter
So if you don't buy the bridge software, you can't do that
I think I did as you said but it doesn't seem to work and I don't know why...
document = CATIA.ActiveDocument
selection = document.Selection
selection.Search "(CATLndSearch.Product),all" ===> selection of all the products of my assembly
NbParts = selection.Count
For i = 1 To NbParts
set sel =...
Hey guys, likely the last time I'm asking you something but I need a little help again
Here is my loop to select the edges, that works alone
Sub CATMain()
Dim intNbEdges As Integer
Dim doc, sel, spa, ref, measurable
Dim inputObjectType(0)
Dim i As Integer
Set doc =...
So the way of doing that would be:
Make a big selection
=> put it into a collection
=> make a new selection inside that collection
=> select the object i and reframe on
Is that so?
Hi guys! That's me again but I need your help again for the last time I think!
I'm still on my piping circuit and I got a new question to ask you: I make a selection of all my parts but on each part I need to make a little selection so inside my loop I put a CATIA.StartCommand("Reframe On")...
I tried a new way to do it but it failed, maybe you can tell me where is the error.
I tried "sel.Search("Type=TriDimFeatEdge, all")" but Method Search failed. So I wanted to add TriDimFeatEdge as a new support of search.
In automation it says that Add method will take an AnyObject, but when I...
I'm still stuck on my problem of edges so I have to ask again, but in a better way:
Does anyone knows what are the items selected by the tools palette when you make Status = sel.SelectElement3(inputObjectType, "Select the edge", True, CATMultiSelTriggWhenUserValidatesSelection, False)?
Because I...
Yes! It works! Thanks Eric!
For the selection, do you have an idea about why the edges are not selected by the Tools Palette? I can't find anything about it on internet.
Also, I tried to automatize it, making a selection by the edges, but the command I tried (sel.Search...
But when I select all the edges of my part one at a time, there won't be any problem, and on this part I'm sure all I have are circular edges (start and end of a pipe).
If I put a "on error goto 0", I will have to make a new selection, right?
Yes, the inputObjectType(0) = "TriDimFeatEdge" only allows me to select circular edges, I tried it on several models.
I presume the error is in the loop but where is the question... Do I need to reinitialize one of the variables? Like coordinates?
I got a little problem with my loop: on multiple selections, I only got the 1st element selected which gives me the results but after I got an error "Coordinates: type non compatible", so either I've got a problem in my loop or the selection method is wrong.
Sub CATMain()
Dim intNbEdges As...