×
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

Scripting Autocad from MathCAD using VBScript

Scripting Autocad from MathCAD using VBScript

Scripting Autocad from MathCAD using VBScript

(OP)
Back again in the pursuit of drawing through mathcad.

Now I'm trying to draw from mathcad in Autocad using the scipted component. Are other people doing this? My VBScript skills are pretty limited and I'm stuck at trying to find the commands for VBScript which will create a line, circle, polyline etc. in Autocad. I'm also unsure of how that command will go.

If i have something like this:

Dim acadPLine
Dim x(6)
x(0)=1      'setting x and y coordinates for 3 pt polyline
x(1)=1
x(2)=5
x(3)=6
x(4)=8
x(5)=12

Set acadPLine = fdsafdjsklajfd;(x) -- not sure what to put after this equal sign.

Any hints? Also having a really hard time finding resources on the internet for using VBScript in Autocad. Are there books or sites with information?


 

RE: Scripting Autocad from MathCAD using VBScript

What version of autocad and mathcad are you using?

If you are using a recent version you can write a standalone version using VB.Net or you could try using VB for Applications in AutoCAD because versions 13 and 14 of mathcad are now xml based so you can interrogate the file to obtain the variable values.

RE: Scripting Autocad from MathCAD using VBScript

(OP)
I'm using V14.

The reason I was hoping to do it directly in Mathcad was because I would like to have the drawing update on the design sheet as I refresh the parameters. I could do it outside of mathcad and call the variables. Or just have mathcad export a simple script text file, but i would like to make the whole design process into one step that is easily reiterated if the original design is not adequate. Do you think this is  not readily achievable? Programming is not my forte.  

RE: Scripting Autocad from MathCAD using VBScript

I'm going to develop a tool that will do something similar but the way I was going to do it was to create a piece of software that stood on it's own and talked to MathCAD and AutoCAD independantly.

To me that seemed the easiest solution and, if you then change to another CAD or symbolic program you just have to rewrite one section.

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