HOW TO GET POSITION AND ROTATION VALUES
HOW TO GET POSITION AND ROTATION VALUES
(OP)
Hi, I want to get position values and rotation values which belongs interfaces by creating macro?CAn you give me any idea?Thank you.
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
HOW TO GET POSITION AND ROTATION VALUES
|
RE: HOW TO GET POSITION AND ROTATION VALUES
www.coe.org/p/fo/et/thread=15346
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
MsgBox "Part Volume: " &MyProduct.Analyze.Volume
MsgBox "Part Mass: " &MyProduct.Analyze.Mass
Option Explicit
Dim strSearch As String
Dim PartFound As Boolean
'Dim MySelection As Selection
Sub CATMain()
Dim MyDoc As Document
Dim MyProduct As Product
Set MyDoc = CATIA.ActiveDocument
Set MyProduct = MyDoc.Product
'Set MySelection = MyDoc.Selection
strSearch = InputBox("Input Search String")
PartFound = False
If strSearch = "" Then
MsgBox "Search String is Empty", vbExclamation, "Error"
End
End If
Call Traverse(MyProduct)
If PartFound = True Then
MsgBox "Part Found", vbInformation, "Success"
Else
MsgBox "Part Not Found", vbExclamation, "Fail"
End If
End Sub
Sub Traverse(MyProduct As Product)
Dim i As Integer
Dim PartName As String
If PartFound = True Then
Exit Sub
End If
For i = 1 To MyProduct.Products.Count
If MyProduct.Products.Item(i).Products.Count = 0 Then
PartName = MyProduct.Products.Item(i).ReferenceProduct.Parent.Name
If PartName = strSearch Then
PartFound = True
Dim MySelection As Selection
Set MySelection = MyProduct.Parent.Selection
MySelection.Clear
MySelection.Add MyProduct.Products.Item(i)
CATIA.StartCommand "center graph"
CATIA.StartCommand "reframe on"
MsgBox "Part Volume: " &MyProduct.Analyze.Volume
MsgBox "Part Mass: " &MyProduct.Analyze.Mass
End If
Else
Call Traverse(MyProduct.Products.Item(i).ReferenceProduct)
End If
Next
End Sub
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
First advice, check Eric's post about posting pictures, if you are on a mobile connection you don't want to do traffic downloading a bmp file with big size, so you will not get an answer so soon.
Second advice is to check the v5automation.chm file in CATIA installation folder, there is an example there how to copy-paste-keep-absolute-position of a product, you can use it to understand more things.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: HOW TO GET POSITION AND ROTATION VALUES
Secondly I tried to entegrate copy-paste code unfortunately I am unsuccesful about this.I add text file.This file returns "set component is not supported in Visual basic" compile error.How can I figure out?
Regards
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
This is what you are looking for:
CODE --> CATVBA
... Dim oAxisComponentsArray(11) prod.Position.GetComponents oAxisComponentsArray ...Check the online doc to understand the oAxisComponentsArray(11) values...
indocti discant et ament meminisse periti
RE: HOW TO GET POSITION AND ROTATION VALUES
RE: HOW TO GET POSITION AND ROTATION VALUES
indocti discant et ament meminisse periti
RE: HOW TO GET POSITION AND ROTATION VALUES
REGARDS