Well,
Just as I posted that I cracked it - at-least partly.
First I could the root fixes using:
oSelection.Search "CATAsmSearch.MfFixConstraint.Name=Fix'.'*,oDocument"
then search for the component node fixes using:
oSelection.Add oProducts 'Select the component node.
oSelection.Search...
Hi Guys,
Is there a way of checking that each part in a component node is fixed? Currently I count all the fixes in the root of the document:
oSelection.Search "CATAsmSearch.MfFixConstraint.Name=Fix'.'*,oDocument"
then count ALL the fixes:
oSelection.Search "CATAsmSearch.MfFixConstraint,all"...
The search orders are correct.
So my machine points at Folder A, their machine points at Folder B, and the data from Folder A has been copied into Folder B, with no corruption.
Hi Guys,
I keep coming up against a problem whereby when I send a product with the associated parts to another user, that on occasion the data will exhibit broken links even though the part file is there and loads absolutely fine on my machine (with a cleared cache or not).
Is the...
Thanks. That worked a treat.
My code is now:
Sub Test()
Set oDocument = CATIA.ActiveDocument
Set oProduct = oDocument.Product
Set oProducts = oProduct.Products
Set oSelection = oDocument.Selection
Set oConstraints = oProduct.Connections("CATIAConstraints")
Set...
HI Guys,
Pulling my hair out here, because whatever I do I cannot get instances within a component to rename.
Essentially I have a product with a component at the end of the tree with loads more parts inserted in there.
This code drills down to it and then renames them sequentially:
Sub...
More accurate inertia calculations require more detailed data.
Assuming the CofG is lumped into one point isn't as good as all the parts separated.
I've reworked the code now so pausing is no longer needed.
Essentially now I open up the top level product, search for each item in the...
What would the full string be?
oSelection.Search (Name='Apple.2' & ('Product Structure'.Product 'Assembly Design'.Product));all
[That doesn't work :p]
(I should have said I want to select the found item!!)
Many Thanks!!!!!
Hi Guys,
Another little problem I can't for the life of me figure out.
I want to search for a specific Instance of something, for example "Apple.2". I have a SearchString Var with "Apple.2" in it.
How do I then search for that in a product?
I've tried:
oSelection.Search...
Hi Lukasz,
Thanks. This works in Alt+F11 yes? (The VBA edit window - not catscript?)
Reason being I get an error on this:
Public Sub ShellandWait(ByVal ProcessPath As String)
Dim objProcess As System.Diagnostics.Process
Try
objProcess = New...
Hi Ferdo,
Had considered that, but there are multiple instances of parts which only show their true CofG when in the Product.
I've managed to find some code that closes the window for me:
http://www.pbdr.com/vbtips/api/FindCloseAPI.htm
ut the problem now is, even with DoEvents multiple...
Hi Guys,
I'm currently writing a script to extract Inertial Data from a product of numerous parts.
The problem I'm coming up against is that I need to run CATIA.StartCommand ("Measure Inertia") and once I've got all the data from the Parameters fields (E.g. "Gx =...
Hi Guys,
I have the following code:
Dim objViewer3D As Viewer3D
Dim objCamera3D As Camera3D
Set MainDocument = CATIA.ActiveDocument
Set objCamera3D = MainDocument.Cameras.Item(1)
objViewer3D.Viewpoint3D = objCamera3D.Viewpoint3D
Dim DBLBackArray(2)
objViewer3D.GetBackgroundColor...
After having a crack at it i've managed to recreate the reference axis as "Created Axis" and managed to get the CofG calculation too using the following code:
Dim MyMeasure
Dim mycoord(2)
Set ref1 = oPart.CreateReferenceFromObject(oPart.MainBody)
Set MyWkBnch =...
HI Mate,
I had a good search through the documentation and it doesn't seem to mention anything about automating the axis?
I need to achieve two things:
1. Create an axis based on values that I need to extract from the new 'origin' axis.
2. Use this created axis to do my measurements of CofG...
Hi Guys,
Another one I can't work out! :(
I have the 'address' (For Example: Part\Geometrical Set\Sub Geo Set\Name) for a parameter, for which then I get the value from using:
Parameters.Item("Part\Geometrical Set\Sub Geo Set\Name").Value
Now sometimes not all the parameters exist, so the...