crushmaster Posted May 12, 2010 Posted May 12, 2010 the dwg drawing is created command-by-command,so it is possible to use a script file to creat a dwg drawing,what about the reversal convertion,say from dwg to script?i am wondering whether there are some intellectual programs solving this? Quote
dbroada Posted May 12, 2010 Posted May 12, 2010 it is possible. Sit down and list each object in turn and write what you get into notepad. repeat for all objects. Why? Quote
crushmaster Posted May 12, 2010 Author Posted May 12, 2010 but now most of my dwg drawings are from 3d softerware like Inventor,modelling in 3d environment and then directly converted to 2d dwg files,not haveing the process of input commands Quote
DNK Posted May 12, 2010 Posted May 12, 2010 the dwg drawing is created command-by-command,so it is possible to use a script file to creat a dwg drawing,what about the reversal convertion,say from dwg to script?i am wondering whether there are some intellectual programs solving this? I use Hurricane for scripting, and it has an option to capture AutoCad commands to create a script. Essentially, you create the drawing via command line, press F2, copy and paste it into the Hurricane tool, and it creates the script. It's not 100% fool proof, but it'll get you 90% there. Quote
crushmaster Posted May 13, 2010 Author Posted May 13, 2010 I use Hurricane for scripting, and it has an option to capture AutoCad commands to create a script. Essentially, you create the drawing via command line, press F2, copy and paste it into the Hurricane tool, and it creates the script. It's not 100% fool proof, but it'll get you 90% there. hi,dnk,i think you misunderstand me,my dwg files are converted from 3d inventor softerware,so i do not have the process of typing command into the commandline and to record them!but anyhow thank you for your reply! Quote
BIGAL Posted May 14, 2010 Posted May 14, 2010 Do you have 3D inventor ? or is it that you actually want a command line version of achieving the same output as inventor has done in a fraction of the time required in plain Autocad Quote
dbroada Posted May 14, 2010 Posted May 14, 2010 In my first post I meant YOU had to work out how each item would be created and write that down. It would be impossible to determine the process commands used to create the drawing as we all do it different ways. I tend to use lots of XLINEs and trim, others use LINEs while others will use PLINEs. All look identical on paper and some will look similar in a list but they weren't crated in the same way. I guess a translator could use a best guess approach but certain items need a particular approach that may not be apparent to anybody but the original draughtsman. I'm still at a loss to work out what you are trying to achieve. You read a drawing that creates a scipt and you do what with that script? Make a drawing from it??? Quote
crushmaster Posted May 14, 2010 Author Posted May 14, 2010 Do you have 3D inventor ? or is it that you actually want a command line version of achieving the same output as inventor has done in a fraction of the time required in plain Autocad yes,your understanding is right, Quote
Rebel Posted May 14, 2010 Posted May 14, 2010 I'm not sure if I understand your request correctly or if this will even help, but a dxf file is a code based file, you can even open with notepad and see the coding that creates the geometry within the drawing. Quote
crushmaster Posted May 14, 2010 Author Posted May 14, 2010 In my first post I meant YOU had to work out how each item would be created and write that down. It would be impossible to determine the process commands used to create the drawing as we all do it different ways. I tend to use lots of XLINEs and trim, others use LINEs while others will use PLINEs. All look identical on paper and some will look similar in a list but they weren't crated in the same way. I guess a translator could use a best guess approach but certain items need a particular approach that may not be apparent to anybody but the original draughtsman. I'm still at a loss to work out what you are trying to achieve. You read a drawing that creates a scipt and you do what with that script? Make a drawing from it??? sometimes i am not sure about the reasons,the old dwg file can not opened,even the 'recover' cannot help. A script file is much more reliable and the files can be much smaller.And in your example,in fact i do not pursue 'xline' or 'line' command used,in any way onlyif the drawings is created as now it is is ok,thank you for your post again! Quote
crushmaster Posted May 14, 2010 Author Posted May 14, 2010 I'm not sure if I understand your request correctly or if this will even help, but a dxf file is a code based file, you can even open with notepad and see the coding that creates the geometry within the drawing. is the dxf code some kind of programming language?how can it be used to recreat the original drawing? Quote
Rebel Posted May 17, 2010 Posted May 17, 2010 Sorry I missed your reply. I don't really know how to correctly answer that. I guess you could say that, think of it as similar to CNC programming code. The code maps out the geometry within the drawing. Quote
crushmaster Posted May 17, 2010 Author Posted May 17, 2010 thank you for your answer,Rebel,maybe i should find some reference materials to study the format of drawings.Any suggestions would be welcome too Quote
BIGAL Posted May 18, 2010 Posted May 18, 2010 How complex an object are you trying to create ? The whole idea behind being able to program Autocad is that if you want to create a certain object but with subtle differences then you can write your own program, this is the basis of the ACAD add on industry and has been a feature of ACAD from day dot. We have tiny simple programs that do only a couple of steps but are started by answering a couple of questions say length & width, pick point it then draws a box with a couple of offsets. repeat this 50 times in a drawing and its a massive saving. In reading the posts I think your heading in the wrong direction trying to amend the values in a dxf is easy but finding which one to change would be a nightmare. Paste an image or dwg of what you are trying to achieve and I think you will head in a better direction. Quote
omarzedan Posted May 10, 2022 Posted May 10, 2022 Dear All I download several drawings from the internet for some products like (PLC, circuit brakers, etc.) and I try to use VBA to draw them, Can I get the script file from the existing drawings? Thanks in advanced Quote
BIGAL Posted May 11, 2022 Posted May 11, 2022 NO Yes you can use VBA to draw autocad objects. You may need to install the VBA add on module its not installed as part of a normal Autocad install. Have a look at this excel example its macro is VBA. If you run the code inside Autocad using VBA you don't need the application part. draw object xl acad.zip Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.