Hi Everyone,
OK, I've got two parts in session: PARTA and PARTB. PARTB is active and displayed. I want to make PARTA active and displayed.
Using the VB API, I can successfully connect to the session, I can successfully check that PARTA is in session, I can make PARTA the active part, but I cannot bring its window to the front and display the part; PARTB's window is displayed and not active.
Does anyone know how to do this?
Here is some code (all the pfcls objects are correctly defined):
FoundModel = False
Ihit = -1
models = session.ListModels ' get list of models in session
If (models.Count > 0) then ' there are models in session
For J = 0 to (models.Count - 1)
model = models(j)
If (model.FullName = "PARTA") then
FoundModel = True
Ihit = j ' save the index
End If
Next
End If
If (FoundModel) then
model = models(Ihit)
window = session.GetModelWindow(model) ' get handle to model's window
window.Activate()
model.Display()
End If
At this point, PARTA is the active part and not displayed. I have to manually click the switch windows icon to display it.
Any help would be greatly appreciated. Thanks!
OK, I've got two parts in session: PARTA and PARTB. PARTB is active and displayed. I want to make PARTA active and displayed.
Using the VB API, I can successfully connect to the session, I can successfully check that PARTA is in session, I can make PARTA the active part, but I cannot bring its window to the front and display the part; PARTB's window is displayed and not active.
Does anyone know how to do this?
Here is some code (all the pfcls objects are correctly defined):
FoundModel = False
Ihit = -1
models = session.ListModels ' get list of models in session
If (models.Count > 0) then ' there are models in session
For J = 0 to (models.Count - 1)
model = models(j)
If (model.FullName = "PARTA") then
FoundModel = True
Ihit = j ' save the index
End If
Next
End If
If (FoundModel) then
model = models(Ihit)
window = session.GetModelWindow(model) ' get handle to model's window
window.Activate()
model.Display()
End If
At this point, PARTA is the active part and not displayed. I have to manually click the switch windows icon to display it.
Any help would be greatly appreciated. Thanks!
Last edited: