I am trying to write a lisp routine that copies some titlesheet files from a certain directory depending on the client. I am trying to get my dcl file to come up in the preview but i cant seem to get it to work. If someone could take a quick look at this i would appreciate it. I am still working on the lisp code but im having trouble getting my dcl file to display in the visual lisp preview.
//Add SK Sheets dialog- works with "skadd.lsp"
skaddition : dialog { label = "ADD SK";
fixed_width=true;
width=50;
: row {
fixed_width=true;
width=45;
: boxed_radio_column {
label = "Client";
fixed_width=true;
width=25;
: radio_button {
label = "xxx";
key = "Copy_xxx";
tag = "Copy xxx";
trim = true;
action ="(setq Cname 0)";
}
: radio_button {
label = "yyy";
key = "Copy_yyy";
tag = "Copy yyy";
trim = true;
action ="(setq Cname 1)";
}
: radio_button {
label = "zzz";
key = "Copy_zzz";
tag = "Copy zzz";
trim = true;
action ="(setq Cname 2)";
}
: boxed_column {
label = "Sheet Size";
fixed_width=true;
width=25;
: toggle {
label = "8.5x11";
key = "8.5_x11";
}
: toggle {
label = "11x17";
key = "11_x17";
}
: boxed_column {
label = "Orientation";
fixed_width=true;
width=25;
: toggle {
label = "Horizontal";
key = "Hor";
}
: toggle {
label = "Vertical";
key = "Ver";
}
: boxed_column {
label = "Title Location";
fixed_width=true;
width=25;
: toggle {
label = "Bottom";
key = "Bot";
}
: toggle {
label = "Right";
key = "RGT";
}
: spacer {}
ok_cancel;
}
You are missing 5 curly brackets, 4 for closing every boxed_column and one to close dialog
AND : spacer should be written as spacer ;
Thanks for the help. This is strange but at home i get this message when i try to preview dcl files.; warning:cannot create tmp file for DCL: "C:/Program Files/Autodesk/AutoCAD 2014/$vld$.dcl". It works fine on my office computer. Has anyone come across this before?
@sovby wrote:
Thanks for the help. This is strange but at home i get this message when i try to preview dcl files.; warning:cannot create tmp file for DCL: "C:/Program Files/Autodesk/AutoCAD 2014/$vld$.dcl". It works fine on my office computer. Has anyone come across this before?
Look into Windows File and Folder Permissions sovby
Thanks, that worked. i had to go into the properties of the directory that my autocad is installed in & set it to allow full control. i added the brackets as was suggested but the preview is blank. it doesn't have the name of the dcl file so i cant pick it. Maybe i didnt put the brackets in the right place but at least i get the preview box now
Got it to work pretty good. It's a matter of knowing where & when to add a bracket. I had to start over & build it from scratch. I added piece by piece & tested it each time. Now it works. but the only thing is i was trying to make a couple of the boxes be on the right hand side.
I would suggest the following:
bx1 : boxed_column { width = 16; height = 6.5; fixed_width = true; fixed_height = true; } bx2 : boxed_column { width = 16; fixed_width = true; } skadd : dialog { label = "ADD SK"; spacer; : row { : bx1 { label = "Client"; : radio_column { fixed_height = true; : radio_button { label = "CDG"; key = "CDG"; } : radio_button { label = "McDonalds"; key = "McDonalds"; } : radio_button { label = "Wendys"; key = "Wendys"; } } spacer; } : bx1 { label = "Sheet Size"; : column { fixed_height = true; : toggle { label = "8.5 x 11"; key = "85X11"; } : toggle { label = "11 x 17"; key = "11X17"; } } spacer; } } : row { : bx2 { label = "Orientation"; : column { fixed_height = true; : toggle { label = "Horizontal"; key = "Horizontal"; } : toggle { label = "Vertical"; key = "Vertical"; } } spacer; } : bx2 { label = "Title Location"; : column { fixed_height = true; : toggle { label = "Bottom"; key = "Bottom"; } : toggle { label = "Right"; key = "Right"; } } spacer; } } ok_cancel; }
I would recommend performing all AutoLISP operations from within your AutoLISP program.
That's perfect Lee. That's exactly what i wanted. Now the challenge is to make the lisp routine work with the dialog box. I'm not sure if this needs to be two routines or if i can do it with one. What im working on now is getting it to copy the right title blocks over to the current directory. After i get that working i want to see if i can make it create a new tab & then attach the titleblock as an xref. Hopefully in one routine.
You're welcome sovby - good luck with the rest of the program!
@sovby wrote:
Thanks, that worked. i had to go into the properties of the directory that my autocad is installed in & set it to allow full control. i added the brackets as was suggested but the preview is blank. it doesn't have the name of the dcl file so i cant pick it. Maybe i didnt put the brackets in the right place but at least i get the preview box now
Good for you sovby, Good luck with the rest of the program 🙂
I would recommend performing all AutoLISP operations from within your AutoLISP program.
I concur, would recommend the same as well.
I ended up going in another direction due to some help i received from a colleague. Here is the final routine if anyone would like to take a look at it.