Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

OverLoad Properties automation

Status
Not open for further replies.

sri91

Mechanical
Aug 29, 2019
42
IN
Hello All,
how to automate overload properties with Win API. I have seen a thread that it can be done either with win API or CAA. I dont have CAA license. Please help.

Thanks
Sri
 
Replies continue below

Recommended for you

Anybody have any Idea? Please help.

Thanks
Sri
 
Hello All,
I have written a code to activate overload properties and go to assembly and select the required parts and come back to the drawing file. But after coming back to drawing file these selected 3D parts are not present in the overload properties window. These are coming only if we select the parts manually. Can anyone have any idea on this. Please help.

Sub CATMain()
Dim catobj As Object
Set catobj = CreateObject("CATIA.Application")

Dim doc1 As DrawingDocument
Set doc1 = catobj.ActiveDocument

Dim windows1 As Windows
Set windows1 = catobj.Windows

Dim asmWindow1 As Window
Dim drwWindow1 As Window
Set drwWindow1 = catobj.ActiveWindow


Dim view1 As DrawingView
Set view1 = doc1.Sheets.Item(1).Views.Item(3)

Dim sel1 As Selection
Set sel1 = catobj.ActiveDocument.Selection
sel1.Clear

sel1.Add view1

CATIA.StartCommand ("Overload Properties")

Set asmWindow1 = windows1.Item(1)
asmWindow1.Activate

Dim asmDoc1 As ProductDocument
Set asmDoc1 = CATIA.ActiveDocument

Dim prod1 As Product, prod2 As Product
Set prod1 = asmDoc1.Product

Dim children1 As Products
Set children1 = prod1.Products

For Each prod2 In children1
If InStr(UCase(prod2.name), "NUT") <> 0 Then
Dim sel2 As Selection
Set sel2 = asmDoc1.Selection
sel2.Clear
sel1.Clear
sel2.Add prod2
End If
Next

drwWindow1.Activate

End Sub


Thanks
Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top