Unfortunately that didn't work! Any ideas... I have my code below
Dim InputObject(0)
InputObject(0) = "Edge"
Dim coord(2) As Variant
Set ocentre = CATIA.ActiveDocument.Selection
Status = ocentre.SelectElement2(InputObject, "Select Circle", False)
Set otemp = ocentre.Item(1)
Set oprod =...
Okay sorted that out.
Finally.... how can I get the instance name of the part in a product if I select an edge on the part using selectelement2?
Cheers
Got it to work with the circles!
2 clicks are needed for direction so circles seems the best way to do it.
Do you know how to get the diameter/radius of a circle from selectelement2?
I got creating a point in the circle then modified it so it doesn't append.
Had a look through this. Looks very useful.
Unfortunately it does not tell me what I want. I think I am going along the right lines now though...
If I select the top circle and the bottom circle of the hole, create a point in the centre then get the coordinates of the points and do math to...
Sub CATMain()
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
Dim product2 As Product
Set product2 = products1.Item("FIXINGS")
Dim...
Okay forget the face for now.
Basically I want to have a button to position a cap screw head into the product by selecting a hole axis and a face.
So when assembling a screw as normal you would bring it into the assembly, then snap the central axis of the screw to the central axis of the hole...
Hello,
I am looking for a macro to find 2 coordinates of a hole axis and 2 for a face.
I want it to work by running the macro, select axis, msgbox with 2 coordinates, select face, msgbox with 2 coordinates.
Any ideas
Thanks,
Drew, I feel this is a step in the right direction!
Firstly I can't find an onLoad event? Where would I find this?
And Secondly, is there any way I can apply this to CATIA globally instead of applying a reaction to a part?
Thanks
Hi Ferdo,
The file will be opened from either double clicking or from file > open in CATIA.
I need a message to know when I have opened a R18 file in R24. Do you know any way of doing this? Any links to application coding for it?
Will I need to do this outside of CATIA or can it be done...
Hello,
I need a way of running a Macro every time a part is opened.
I have written the Macro just need to find a way of running it!
The Macro checks the Rev Number the part was created in... EG V5R18 or V5R24.
Any ideas?
Thanks,
Will
Hello,
I need a way of running a macro every time a part or product is opened. What is the best way of doing this?
Is it possible to modify the open command to do this? And if so how?
Thanks,
Will