Find Instance Name from Selecting Edge Using SelectElement2
Find Instance Name from Selecting Edge Using SelectElement2
(OP)
Hello,
I need to know the coordinates of a point within a CATPart with respect to the CATProduct/Assembly origin.
How can I do this?
Cheers
I need to know the coordinates of a point within a CATPart with respect to the CATProduct/Assembly origin.
How can I do this?
Cheers





RE: Find Instance Name from Selecting Edge Using SelectElement2
If you need manual info, then double click the reference you want to use - defined by the blue level - (root product or sub level par) then use the measure tool...
indocti discant et ament meminisse periti
RE: Find Instance Name from Selecting Edge Using SelectElement2
I am after a script...
What Math would I use to get position from the root product?!
Thanks
RE: Find Instance Name from Selecting Edge Using SelectElement2
indocti discant et ament meminisse periti
RE: Find Instance Name from Selecting Edge Using SelectElement2
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
RE: Find Instance Name from Selecting Edge Using SelectElement2
or something like that
indocti discant et ament meminisse periti
RE: Find Instance Name from Selecting Edge Using SelectElement2
CODE -->
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 = ocentre.FindObject("CATIAPart") Set partDocument1 = documents1.Item(oprod.Parent.Name) Set oPart = partDocument1.Part Set ohsf = oPart.HybridShapeFactory Set oRef = otemp.Reference Set opoint = ohsf.AddNewPointCenter(oRef) opoint.Compute opoint.GetCoordinates coord MsgBox ocentre.Item(1).Value.Parent.Parent.Parent.Parent.Name 'This is the line I need to get the instance name of the part the selected edge is on! End