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!

Type of active document 1

Status
Not open for further replies.

elmundo777

Automotive
Jun 23, 2020
93
0
0
BY
Interested in the question: I have a form of VBA\vb.net\winforms. At startup, documents opened in the Catia are initialized there.
How can I check the type of the active open document?
And if it's not a part or a product, then display a message?
p.s. searching the forum did not answer my question

what i tried to do:

Code:
 Private Sub Form1_Load(sender As Object, e As EventArgs)
dim strDocType  = TypeName(CATIA.ActiveDocument)
if  strDocType <> "ProductDocumemt" or strDocType <> "PartDocument" then
    MessageBox.Show("Active document must be product or part")
    System.Windows.Forms.Application.Exit()

end if

End sub

I want to prevent working with documents such as drawing, model, step, etc.

Need to check for parts and product

I also did not find information in the V5Automation.chm file
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top