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

??? VBScript Macro for a shaft ???

??? VBScript Macro for a shaft ???

??? VBScript Macro for a shaft ???


I am trying to generate a macro for "shaft" creation. I tried with different profiles and axes, but I cannot generate a functional macro. It gives me an error when I run it.

Here is a part of the code I have:

Set shapeFactory1 = part1.ShapeFactory
Set reference1 = part1.CreateReferenceFromName("")
Set shaft1 = shapeFactory1.AddNewShaftFromRef(reference1)
Set bodies1 = part1.Bodies
Set body1 = bodies1.Item("MechanicalTool.1")
Set sketches1 = body1.Sketches
Set sketch1 = sketches1.Item("Sketch.1")
Set reference2 = part1.CreateReferenceFromObject(sketch1)
shaft1.SetProfileElement reference2

And the error is "the method update failed"

Does anybody have a cue?


RE: ??? VBScript Macro for a shaft ???

Hi,it may be the problem here in this line "Set reference1 = part1.CreateReferenceFromName("")" or "Set sketch1 = sketches1.Item("Sketch.1")",check all the names u specified in this script matches with those you have in part.


RE: ??? VBScript Macro for a shaft ???

Tahnk you for this suggestion, but unfortunatelly, this is not the reason. The names match the ones I have in the part.

I have the feeling that the shaft is missing some information, which is strange, because when I construct it on the screen everything is OK...

Does somebody have a functional script that generates a sphere or any kind of "shaft" or "revolving" object?

Thank you!

RE: ??? VBScript Macro for a shaft ???

In fact, the part1 is already defined in the file. I have the error at the very last line of the code - when it wants to update the scene:


If somebody has a macro that generates a shaft or a surface of revolution, please send it!

Thank you in advance!

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


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