SCRIPTS

SCRIPTS

Anonymous
Not applicable
1,560 Views
3 Replies
Message 1 of 4

SCRIPTS

Anonymous
Not applicable

Hi, I'm using a script with insert command.

I want the script to load a DWG file from a folder inside the location of the script.

 

for ex:

 

the script and my DWG file is in C:\ 

I want the script to insert a file to the DWG from C:\folder 

 

can I do that?

0 Likes
Accepted solutions (1)
1,561 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

Yes.

 

INSERT C:\Your\File\Path\YourDrawingName

 

Make sure you include an Enter at the end [for an empty line below that one] if that's the last thing in the Script.

Kent Cooper, AIA
0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant

Now it's occurring to me to wonder....  Some people use the word "script" around here in a more generic sense than AutoCAD's definition of the word.  My previous Reply is about AutoCAD's meaning, using a .SCR filetype, invoked with the SCRIPT command specifically.  If you meant it more loosely, as some people use the word, intending something like a macro or an AutoLisp routine, that would make a difference.  [For example, you can't use single backslashes as file path separators in AutoLisp, because they are used to trigger certain control characters, so you need to use either forward slashes or double backslashes.]  But it can be done through any of those approaches -- you just need to use the right syntax for the particular approach.

Kent Cooper, AIA
0 Likes
Message 4 of 4

Anonymous
Not applicable

I'm new to coding for autocad so I don't know yet the small staff.

I'm working on a C++ code that will generate a command chain

so by script I was referring to the .SCR file

 

0 Likes