Forum Replies Created

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • in reply to: rename part in product #1282

    ramzar
    Participant

    The selection would be made before starting the macro. I’ll select all the thing i want to rename before starting the macro, so there will be something in the selection.

    in reply to: Activate solid in a part #1281

    ramzar
    Participant

    Still dosen’t work. It’s not really important, i know that i need to be in a product.

    in reply to: Activate solid in a part #1275

    ramzar
    Participant

    Hi Matt, the code you gave me to verify if i’m in a product don’t work. Instead, it make x number of product and part open where x is the number of part in my assembly.

    in reply to: Activate solid in a part #1271

    ramzar
    Participant

    The macro work now, i just find the answer, well a part of it.

    bIsInactive = oPart.IsInactive(oShape)
    If bIsInactive = True Then

    You where doing a verification if Solide.42 was desactivated. I erase those 2 lines and the macro works perfectly. In fact, If Solide.42 is activated, it can activate it again, it change nothing. I don’t know why it didn’t work, logically, it look ok to verify if “Solide.42” is activate or not and if not, do nothing and go next. Maybe doing a Search, like i did in my first macro attempt would be more simple. I’ll try it.

    Now i want to do a line that verify if i’m active in a product when i start the macro.if not, it show a message box telling me to go in product and re-run the macro.

    • This reply was modified 3 years, 1 month ago by  ramzar.
    • This reply was modified 3 years, 1 month ago by  ramzar.
    in reply to: Activate solid in a part #1270

    ramzar
    Participant

    The macro language is MS VBA??? Because i past it in MS VBA and i run it and got nothing. No error but dosen’t work. I don’t know how work the macro module (ALT+F11). I’ll try to investigate a bit!

    in reply to: Activate solid in a part #1266

    ramzar
    Participant

    Thank you for all the info. I didn’t knew for Alt+F11! that’s gonna help me alot. All my macro i did was is CATScript but now i’ll do it in VBA

    The macro don’t work. I got no error but “Solide.42” dosen’t activate. There is a good part done, i don’t think we are far away from this macro work.

    And i work with Catia V5 R21

    • This reply was modified 3 years, 1 month ago by  ramzar.
    in reply to: Activate solid in a part #1263

    ramzar
    Participant

    I just try your macro and it work! it go in each part but the screen is flashing when it goes in each part, is there a way to stop that. Also, i try to put something after “‘Do something to oShape” : oPart.Activate.oShape but it dosent work.

    Seriously, i have to that you again for your help, you can’t imagine how it gonna be useful!

    • This reply was modified 3 years, 1 month ago by  ramzar.
    in reply to: Activate solid in a part #1262

    ramzar
    Participant

    Hi, thank you Matt for all your answer and your devotion. It’s really appreciated. To answer all your question:

    for the search, i only got the “No desactivated features” if there is really no desactivated feature. This part work.

    I try to use CATScript. I have no experience with VB or anything close to VB, CATScript or VBScript. I’m trying and i’m learning at the same time. Not as much easy as i was thinking!!!

    The thing that i want to do with this macro is: In my main product i have multiple part. In my part, i have “Solide.42” desactivated. In one shot, i want to ativate all “Solide.42” because the only way to do it for now is to go in each part and then activate it. It’s a long process and i want to cut some time because somethime we have like 100-150 even 200 part with “Solide.42”.

    Thank you for your macro, i’ll thy it soon.

    (Sorry for my bad english, i hope that you understanding me well)

    Again, thank you for you help, it’s really appreciated!

    in reply to: Activate solid in a part #1250

    ramzar
    Participant

    Hi Matt, thanks for your answer. Unfortunally, i try to add that:

    Dim partProduct1 as Product ‘add this variable

    For I = 1 to product1.Products.Count
    Set partProduct1 = products1.item(I)
    Set partDocument1 = partProduct1.ReferenceProduct.Parent
    Set part1 = partDocument1.Part
    ‘Continue with your code

    But it dosent work.

    Also, i try:
    CATIA.ActiveDocument.Selection.Clear
    CATIA.ActiveDocument.Selection.Add part1
    CATIA.StartWorkbench (“PrtCfg”)’starts part design
    CATIA.ActiveDocument.Selection.Clear
    ‘Activate your solid

    And it dosent work either. I don’t really know what to do from now!

    (My CATIA is in french, i don’t know if it change something writing a macro)

    • This reply was modified 3 years, 1 month ago by  ramzar.
    in reply to: Activate solid in a part #1234

    ramzar
    Participant

    Thanks you for your answer. I just try to put “Set part1 = partDocument1.part” and now the error is in this line.

    I have an other question, is the code “ApplyWorkMode DESIGN_MODE” make it go in part design? because the only way to activate a solid is when you are in a part, not in a product. So i was wondering if this was correct.

    • This reply was modified 3 years, 1 month ago by  ramzar.
    in reply to: Introduce Yourself #1222

    ramzar
    Participant

    Hi everybody, I’m a mechanical engineering technician. I work with CATIA since 2011 and i just begin to work with macro.

    This site is very useful for me to help me understand macro.

    Thank you!

Viewing 11 posts - 16 through 26 (of 26 total)