Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need Help With DCL Code

10 REPLIES 10
Reply
Message 1 of 11
stanovb
749 Views, 10 Replies

Need Help With DCL Code

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;
}

10 REPLIES 10
Message 2 of 11
pbejse
in reply to: stanovb

You are missing 5 curly brackets, 4 for closing every boxed_column  and one to close dialog

 

AND : spacer should be written as spacer ; 

 

 

Message 3 of 11
sovby
in reply to: pbejse

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?

Message 4 of 11
pbejse
in reply to: sovby


@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 

Message 5 of 11
sovby
in reply to: pbejse

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

Message 6 of 11
sovby
in reply to: stanovb

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.

 

skadd.jpg 

Message 7 of 11
Lee_Mac
in reply to: sovby

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.

Message 8 of 11
sovby
in reply to: Lee_Mac

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.

Message 9 of 11
Lee_Mac
in reply to: sovby

You're welcome sovby - good luck with the rest of the program! Smiley Happy

Message 10 of 11
pbejse
in reply to: sovby


@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.

Message 11 of 11
stanovb
in reply to: Lee_Mac

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost