×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

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!
  • Students Click Here

*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

Jobs

MacroFeature screen redraw

MacroFeature screen redraw

MacroFeature screen redraw

(OP)
Hello everyone...

I give up... I’ve tried everything is possible... I was making a macro feature that creates a retaining ring groove… So I create a temporary cylinder with the same diameter of the shaft, other with the internal diameter of the grove, then I subtract the last from the first and finally I subtract the resulted body from the shaft main body and there should be my feature… well… it is there, I just can’t see… if I pass the mouse pointer over the feature the new feature’s faces and edges are highlighted, but I have to do a forced rebuild to see it. If I delete the feature the same happens, the display won’t update. As I’m new with macro features I tried to do another one to be sure I didn’t do any big mistake. Now my the macrofeature makes keyways, I have a shaft, then I make 2 temporary cylinders and a box between them, I made an union operation with them and to finish I subtract the resulted body from the main shaft body. Same problem… the feature is there but the model don’t update. But with this one not even the force rebuild works, I have to close the model and then reopen, this is the only way to see the keyway in the shaft. Here is the part of the code that creates the bodies and make the operations:

 

Function swmMain(swApp, swModel, swFeature)

    …

    …

    …

    …

    …

    …

    …

    …

 

 

    Dim swModeler As SldWorks.Modeler

    Set swModeler = swApp.GetModeler

    

    If sType = swExternalType Then

        ' RASGO EXTERNO

        Dim sStartCyl As SldWorks.body2

        Set sStartCyl = swModeler.CreateBodyFromCyl(cylDimArray)

       

        Dim sMidBox As SldWorks.body2

        Set sMidBox = swModeler.CreateBodyFromBox(boxDimArray)

        iMacroFeatureData.GetEntitiesNeedUserId sMidBox, IdFaces, IdEdges

 

        cylDimArray(0) = KeywayEnd(0)

        cylDimArray(1) = KeywayEnd(1)

        cylDimArray(2) = KeywayEnd(2)

 

        Dim sEndCyl As SldWorks.body2

        Set sEndCyl = swModeler.CreateBodyFromCyl(cylDimArray)

 

        ResultBodies = sStartCyl.Operations2(SWBODYADD, sMidBox, errorCode)

       

        ResultBodies = sEndCyl.Operations2(SWBODYADD, ResultBodies(0), errorCode)

        

    Else

        ‘ not implemented yet        

    End If

        

    Dim Body As Variant

    Body = swModel.GetBodies2(swAllBodies, False)

    Set swPartBody = Body(0)

    

    If Not swPartBody Is Nothing Then

        Dim resultBodiesPerm As Variant

        resultBodiesPerm = swPartBody.Operations2(SWBODYCUT, ResultBodies(0), errorCode)

    End If

End Function

 

Please, any help will be appreciated since there’s no reference about this part of the API in the web, at least I couldn’t find, and the help is very crap explaining these concepts :o(

 

Best regards,

 

Rodrigo Basniak

SolidWorks Mechanical and Piping Designer

A1 Engenharia e Gerenciamento Ltda

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!


Resources