×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Generate AllCatPart from Product (Vb.net)

Generate AllCatPart from Product (Vb.net)

Generate AllCatPart from Product (Vb.net)

(OP)
Hello
I have a button on the vb.net form.
with its help I try to generate AllCatPart
But nothing happens, but some report menu is called up.
The code I use is below:

CODE --> vb.net

Dim actdoc As ProductDocument
actdoc = Catia.ActiveDocument
Dim MySel As Selection
MySel = Catia.ActiveDocument.Selection
MySel.Clear()
MySel.Add(actdoc.Product)
'CATIA.RefreshDisplay = True
Catia.StartCommand("Generate CATPart from Product...") 

Perhaps something should be highlighted or transferred? Please tell me how to implement this correctly.

RE: Generate AllCatPart from Product (Vb.net)

This command is literally 2 clicks away or pressing 3 buttons. What's the benefit of macroing it?

RE: Generate AllCatPart from Product (Vb.net)

(OP)
This is an example of a button. In fact, in the middle of a large cycle, she should make allcatparts from the list of products and then load them into one product.
The meaning of the question is still the same - the procedure for generating an allcatparts is not performed

RE: Generate AllCatPart from Product (Vb.net)

CODE -->

Dim oBGRoot, oBGProd, sError
        Dim oProd2Part As DECPartToPart
        Dim oAllCatPart As part
        Set oBGRoot = CATIA.ActiveDocument
        Set oBGProd = oBGRoot.Product
        Set oProd2Part = oBGProd.GetItem("DECPartToPart")
        oProd2Part.SetOption ("KeepAnnotations")
        oProd2Part.Run
        sError = oProd2Part.GetError
        If sError <> "" Then
            MsgBox sError, 16, "Exception DECPartToPart. Aborting."
            Exit Sub
        End If
        Set oAllCatPart = oProd2Part.GetResult.part 

regards,
LWolf

RE: Generate AllCatPart from Product (Vb.net)

but in your case you should use
Set oProd2Part = oProduct.GetItem("DECProductToPart")

regards,
LWolf

RE: Generate AllCatPart from Product (Vb.net)

(OP)
com object error in line of code

CODE -->

oProd2Part.SetOption ("KeepAnnotations") 
if i'm comment out this line the code works
Thank you

RE: Generate AllCatPart from Product (Vb.net)

yeah, that's because I used the code for part-to-part conversion...and wanted to keep the annotations.
Something I havn't found any documentation for--just happened to guess right :) Others might find it useful...

regards,
LWolf

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close