Is there a way to enter the filename via a script when using MKSHAPE?

Is there a way to enter the filename via a script when using MKSHAPE?

imuckyu
Participant Participant
498 Views
3 Replies
Message 1 of 4

Is there a way to enter the filename via a script when using MKSHAPE?

imuckyu
Participant
Participant

When you try to use the MKSHAPE command it opens a window where you have to specify the filename and hit save before you can continue.

 

Is there a way to enter this via the commandline?

I already tried to set FILEDIA to 0 but it only works for opening/saving AutoCAD files etc. but it does not seem to work for the MKSHAPE command.

 

 

 

I basically have to loop through a few hundred shapes and would like to avoid manually typing each name everytime.

0 Likes
499 Views
3 Replies
Replies (3)
Message 2 of 4

cadffm
Consultant
Consultant

Hi,

 

this Expresstools ACET-FILE-WRITEDIALOG is not the standard filedialog, so filedia will not work.

I don't know about a commandline variable, but I am not so much familiar with the Express lisp functions.

 

Are you familiar with lisp? MKSHAPEs sourcecode is on your drive, easy to edit it for your needs.

(mkshape shptype bspnt ss fna key name res lst2 mx)

or bypass the dialog only.

Sebastian

0 Likes
Message 3 of 4

imuckyu
Participant
Participant

Thanks for the quick reply!

Where exactly do I find the sourcecode for that?

 

I have used a few LISP commands before but I am not an expert.

 

My initial goal is to use the layername as the shapefile name.

 

 

In your example "(mkshape shptype bspnt ss fna key name res lst2 mx)"

- mkshape calls the mkshape command?

- shptype = .shp?

- bspnt = base insertion point?

- ss = selection?

- fna?

- key?

- name = layername?

- res = resolution?

- lst2?

- mx?

0 Likes
Message 4 of 4

cadffm
Consultant
Consultant

@imuckyu  schrieb:

Where exactly do I find the sourcecode for that?

 

MKSHAPE is part of Expresstools, you will find the sourcecode in your EXPRESS folder

Search for file with c:mkshape inside and you see the MKSHAPE.LSP file.

 

 

 

 

In your example "(mkshape shptype bspnt ss fna key name res lst2 mx)"

- mkshape calls the mkshape command?

 Yes and no, it's not a command -  it calls the lisp defined "mkshape" function

(the lisp defined "command" is c:mkshape)

 

- shptype = .shp?

No, it is "Font" or "Shape"

 

- bspnt = base insertion point?

Sounds good

 

- ss = selection?

for usual

 

- fna?

FileNAme (incl. extension)

 

- key?

Hey, It's not me who need it, it's your job 😉

''''''##

 

I think it is the best choice for you to bypass the dialog only.

This is the part you have to bypass:

(setq fna (ACET-FILE-WRITEDIALOG "MKSHAPE - Select Shape File" acet:mkshape-fna "shp" "Acet:Mkshape" 1665 ))

 

for example:

(setq MyVariableForShapeName  (strcat "D:\\" (getvar 'CLAYER) "."))

 

 

(or MyVariableForShapeName ; if MyVariableForShapeName is nil, the filedialog opens)

      (setq fna (ACET-FILE-WRITEDIALOG ..........)

)

 

 

Sorry, I am out - no time for this

Sebastian

0 Likes