Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Difficulty in running program

Status
Not open for further replies.

makyy

Automotive
Mar 2, 2021
19
0
0
JP
Hello Everyone,
I have one combobox which i populated with DefaultGenerativestyle and inheritance_3D.
Then I have a command button that selects views( front view, back view , left view, isometric view,etc) and populate listbox with the name of the view.

I crated one more command button named run on userform ...
What I want is when I select DefaultGenerativeStyle on combobox and select a view or two(front view, left view) then those view's View style should change to default generative view style when I click on run.

I know that I can use if function but it does not seem to work.

Any help will be appreciated.

Thankyou
 
Replies continue below

Recommended for you

Hello,
Thankyou for replying...
For Combobox I used
Private Sub UserForm_Initialize()
With cmb_SelectStyle
.AddItem "DefaultGenerativeStyle"
.AddItem "Inheritance_3D"
.AddItem "R17_GraphicReplacement"
.AddItem "ShellExpCmd_DrwTemplate"
End With

cmb_SelectStyle.Value = "DefaultGenerativeStyle"


End Sub

To Select the View I used

Private Sub ViewSelect_Click()

Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument

Dim InputObject(0)
InputObject(0) = "DrawingView"

Dim DrwSelect As Object
Set DrwSelect = CATIA.ActiveDocument.Selection

DrwSelect.Clear

Dim Status
Status = DrwSelect.SelectElement2(InputObject, "Select View", False)

For i = 1 To DrwSelect.Count

Dim DrwView
Set DrwView = DrwSelect.Item(i).Value

ListBox1.AddItem (DrwView.Name) 'To get the view in the Listbox1

DrwSelect.Clear

Next

End Sub

I want to use the run button to change the view style
%E7%84%A1%E9%A1%8C1_iyfjvh.png


I tried recording macro for the run button but its not working...
I have to use generative behavior it seems like..
Dim drawingViewGenerativeBehavior1 As DrawingViewGenerativeBehavior
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior


Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior

drawingViewGenerativeBehavior1.ForceUpdate
 
Status
Not open for further replies.
Back
Top