Jump to content

library


wesleyaqua

Recommended Posts

Hi

 

first of all i'm new to autolisp.i already managed to make some scripts and macros and making a new cuix. but now i would like to integrade the BLK_LIB from the link into the cuix.

 

http://web2.airmail.net/terrycad/AutoLISP-Code.htm

 

now my problem is if i use the commands of the program it will be bluricon7.gif if i add all the maps to it.

 

so i would like to adjust the lisp program.

 

now i have to work as follow

command:LIB

"i get a dialog box with all the libraries i made"

select the right one

"get another dialog box like an image menu"

 

i would like to get it like this.

i make a cuix menu with the main folders and some will have sub menus

so if i click i'll go to the image menu directly of the right library

 

my suggestion is i'll get it in a command line version

that i can go like this

command:lib

:(the library)

promps then the right dialog box

 

another suggestion is make a command name for every library

command:(the library) promps the right dialog box

 

i tried with filedia:0 and cmddia:0 to get the line version but it didn't work

 

is there anyone willing to help me with this. the program works very good only i would like to ad a list with text on the left side again but that is for if i get it to work first

 

kind regards

Wesley

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • wesleyaqua

    13

  • Bhull1985

    11

  • Terry Cadd

    1

  • cwake

    1

Top Posters In This Topic

Posted Images

Hi Wesley

I am attempting to help out but your post is a bit unclear, could you elaborate some for me again?

It seems as if you're having trouble in getting your dialog to appear? Are you wanting for the user to type in a command "library" and that will make a dialog appear?

That is certainly possible, through autoLISP and DCL- both of which there are plenty of examples on.

If you're trying to work on the cuiX then that doesn't involve much lisp.

I can't tell you much more without knowing the issue, although I've read your post a few times I have yet to glean one.

Don't fret!

Just post clearly your problems/what you need help with :)

Link to comment
Share on other sites

Hi Wesley

I am attempting to help out but your post is a bit unclear, could you elaborate some for me again?

It seems as if you're having trouble in getting your dialog to appear? Are you wanting for the user to type in a command "library" and that will make a dialog appear?

That is certainly possible, through autoLISP and DCL- both of which there are plenty of examples on.

If you're trying to work on the cuiX then that doesn't involve much lisp.

I can't tell you much more without knowing the issue, although I've read your post a few times I have yet to glean one.

Don't fret!

Just post clearly your problems/what you need help with :)

 

hi i just also found how to manage to open the block lip directly

 

command:(USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil)

 

this works if i put it in command so it moved more to a cuix problem now.

i made a new macro name is reductie

c^c^ (USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil)

 

but that doesn't work to open it

i get the following "error"

 

Command: "(USER_LIB "Test" "K:

 

any idea how to fix this

Link to comment
Share on other sites

Try your macro like this:

 

c^c^(USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\  AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil);

 

this removed the first space after the clearing characters c^c^ and also I added the ";" to "enter" through your command when you select it. Currently without the ";" it places it onto the command line but doesn't enter it.

Hope this helps ;)

Link to comment
Share on other sites

Try your macro like this:

 

c^c^(USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\  AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil);

 

this removed the first space after the clearing characters c^c^ and also I added the ";" to "enter" through your command when you select it. Currently without the ";" it places it onto the command line but doesn't enter it.

Hope this helps ;)

 

hi this didnt work

c^c^(USER_LIB "Test"  "K:\\Projecten\\Engineering\\Standaarddocumenten\\AS_bibliotheek  rev2\\AS_3D\\T\\reductie T\\Test.def" nil);

doesn't work no i get the error

 

also i removed the 2 spaces before AS_bibliotheek rev2

command: c not the dialog box that needs to open

 

already thx for quick respons

Link to comment
Share on other sites

Alright, please copy the error *exactly* and paste it into here for us to see *what* error it's giving you. There are different kinds of errors. That will be a big clue.

Also, your macro is running a function called (user_lib) , which you should have defined somewhere. Please paste it into here because it is likely the source of your error. And we can't fix it without seeing it.

Link to comment
Share on other sites

Alright, please copy the error *exactly* and paste it into here for us to see *what* error it's giving you. There are different kinds of errors. That will be a big clue.

Also, your macro is running a function called (user_lib) , which you should have defined somewhere. Please paste it into here because it is likely the source of your error. And we can't fix it without seeing it.

 

it doesn't give an error it just says command:c and nothing happened

the lsp en dcl are the one from the site i use i think nothing changes at those files

could it be that he opens it and he immediately cancels it there by the c ?

cuix.jpg

Sel_Lib.zip

Test.zip

Link to comment
Share on other sites

Also that function requires that you have slides created.

Did you do "MSLIDE" and create your slides yet?

it creates it own slides i us the command:lib i can select test

also i can use (USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil)

buth display well only if i'll try to make a macro from it nothing happens

Link to comment
Share on other sites

Lisp works inside macros just fine.

It must be a syntax error. Let me try again to paste what should run the command from a macro...

 

^c^c(load "blk_lib.lsp");(USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\  AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil);

 

that should work for you....please ensure it loads the function and then calls the function. Please copy and paste what the output commands are from autocad.

This means what autocad responds...it should give an error, or a message....that is vital information.

Link to comment
Share on other sites

i found a solution

 

i made a script with the (user....)

in and now it work properly.

 

i think the macro cant handle the \\

 

thx for the help

 

now i'll try to add the list box to the dcl file

Link to comment
Share on other sites

Lisp works inside macros just fine.

It must be a syntax error. Let me try again to paste what should run the command from a macro...

 

^c^c(load "blk_lib.lsp");(USER_LIB "Test" "K:\\Projecten\\Engineering\\Standaarddocumenten\\  AS_bibliotheek rev2\\AS_3D\\T\\reductie T\\Test.def" nil);

that should work for you....please ensure it loads the function and then calls the function. Please copy and paste what the output commands are from autocad.

This means what autocad responds...it should give an error, or a message....that is vital information.

 

Dwg_Blks : dialog {
 label = "";
 key = "title";
 initial_focus = "cancel";
 spacer;
 : row {
   : column {
     : list_box {
       label ="";
       key = "???";
       height = 50;
       width = 25;
       multiple_select = false;
       fixed_width_font = true;
       value = "";
     }
   }
   : column {
     : row {
       : icon_image {
         key = "sld1";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld2";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld3";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld4";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld5";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
     }
     : row {
       : column {
         : text {
           key = "sld1text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld2text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld3text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld4text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld5text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
     }
     : row {
       : icon_image {
         key = "sld6";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld7";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld8";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld9";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld10";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
     }
     : row {
       : column {
         : text {
           key = "sld6text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld7text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld8text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld9text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld10text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
     }
     : row {
       : icon_image {
         key = "sld11";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld12";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld13";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld14";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld15";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
     }
     : row {
       : column {
         : text {
           key = "sld11text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld12text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld13text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld14text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld15text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
     }
     : row {
       : icon_image {
         key = "sld16";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld17";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld18";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
       : icon_image {
         key = "sld19";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       } 
       : icon_image {
         key = "sld20";
         width = 25.92;
         height = 7.97;
         aspect_ratio = 1;
       }
     }
     : row {
       : column {
         : text {
           key = "sld16text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld17text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld18text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld19text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         }
       }
       : column {
         : text {
           key = "sld20text";
           label = "";
           width = 25.92;
           fixed_width = true;
           alignment = centered;
         } 
       }
     }
   }
 }
 : row {
   : column {
     : button {
       key   = "previous";
       label = "< Previous";
       mnemonic = "P";
       width = 70;
       fixed_width = true;
       alignment = centered;
     }
     : ok_button {
       mnemonic = "O";
       alignment = right;
       width = 11;
     }
   }
   : column {
     : button {
       key   = "next";
       label = "Next >";
       mnemonic = "N";
       width = 70;
       fixed_width = true;
       alignment = centered;
     }
     : cancel_button {
       mnemonic = "C";
       alignment = left;
       width = 11;
     }
   }
 }
}//Dwg_Blks

 

i changed the default .dcl

i added a listbox and it shows at the right place

the only problem is key = ? i already tried

-sld

-sld1text

-text

-blklist

 

but non work, i'm trying to search in the blk_lib.lsp for the key

Link to comment
Share on other sites

The "key" is how you link an item from the DCL to the LISP coding.

yes i know what the key needs to do but don't know how to get the list.

already tried start list en some things but it didn't worked.

i've contacted the maker of the block lib in hope he can help me with the list. but he already said it was a long time that he programmed it.

Link to comment
Share on other sites

If you haven't already done so, have a read through the online help on filling list boxes, and see if that helps.

http://docs.autodesk.com/ACDMAC/2014/ENU/files/GUID-9C5213CA-B349-4F08-A6B8-960BC3BCFC84.htm

 

It sounds like what you are wanting to do is the three steps as explained on that page:

(start_list "selections")   ;Specify the name of the list box.
(mapcar 'add_list appnames) ;Specify the AutoLISP list.
(end_list)

It won't matter what you decide to call the key in the dialog file, as long as you use a unique name not already in use in the same dialog box.

You would then use that key name to reference it in the (start_list "key") function.

Link to comment
Share on other sites

If you haven't already done so, have a read through the online help on filling list boxes, and see if that helps.

http://docs.autodesk.com/ACDMAC/2014/ENU/files/GUID-9C5213CA-B349-4F08-A6B8-960BC3BCFC84.htm

 

It sounds like what you are wanting to do is the three steps as explained on that page:

(start_list "selections")   ;Specify the name of the list box.
(mapcar 'add_list appnames) ;Specify the AutoLISP list.
(end_list)

It won't matter what you decide to call the key in the dialog file, as long as you use a unique name not already in use in the same dialog box.

You would then use that key name to reference it in the (start_list "key") function.

 

 

yes I'm wanting to do the code you describe.

I'm understand that the key doesn't make big deal.

 

as long that start_list "=to key" is

but the second part of the I'm probably strugling with is the "add_list appnames"

i don't know what it should be. i saw in the .lsp file stuff like blocklist@ i tried to use those but it didn't work.

i should get the list from the def file that it reads in for every lib part.

or what i think would be the easiest is finding out how the "key=sld6text" is made

: icon_image { 
key = "sld10";
width = 25.92;
height = 7.97;
aspect_ratio = 1;
}
}
: row {
: column {
  : text {
    key = "sld6text";
    label = "";
    width = 25.92;
    fixed_width = true;
    alignment = centered;

Cause it are those names I want to see listed. int the lsp i cant find sld1text. so i think the make wrote it in a special way to add always a number or something / block.

Link to comment
Share on other sites

yes I'm wanting to do the code you describe.

I'm understand that the key doesn't make big deal.

 

as long that start_list "=to key" is

but the second part of the I'm probably strugling with is the "add_list appnames"

i don't know what it should be. i saw in the .lsp file stuff like blocklist@ i tried to use those but it didn't work.

i should get the list from the def file that it reads in for every lib part.

or what i think would be the easiest is finding out how the "key=sld6text" is made

: icon_image { 
key = "sld10";
width = 25.92;
height = 7.97;
aspect_ratio = 1;
}
}
: row {
: column {
  : text {
    key = "sld6text";
    label = "";
    width = 25.92;
    fixed_width = true;
    alignment = centered;

Cause it are those names I want to see listed. int the lsp i cant find sld1text. so i think the make wrote it in a special way to add always a number or something / block.

 

Looks like "sld6txt" means the text callout for the slide 6 image, Some parts of the DCL will have code tying the DCL key to the LISP key for the same item.....some DCL keys will not be used in the LISP file because the DCL contains all of the relevant coding for certain tiles, such as text labels. The LISP would probably contain code that sets up the "Slide 6" tile however.

Link to comment
Share on other sites

Looks like "sld6txt" means the text callout for the slide 6 image, Some parts of the DCL will have code tying the DCL key to the LISP key for the same item.....some DCL keys will not be used in the LISP file because the DCL contains all of the relevant coding for certain tiles, such as text labels. The LISP would probably contain code that sets up the "Slide 6" tile however.

if i use sld6text as a key for the list_box is it normal that doens't work? i will retry it again. maybe me list box wast working good yet.

and do you have an idea how to know the titles are connected with the lsp. caus i would like to have sld1text till the last on it creates in the list box.

also if there are more than 20 in the preview. in worst case only the 20 that are displayed. but rather have the full list

Link to comment
Share on other sites

Sorry it is a bit difficult to understand what you're asking.

What I'm trying to have you understand is that "key" is a way to link between the dcl and the lisp file.

If a part of your DCL has a key "sld6text" , that is part of a ": text {" line, then I think it is establishing a naming convention- it's saying that this part of the DCL is meant to add text under "slide 6" in order to label it.

That's how I would understand it at least. That means that there would be a Slide6, which would be an image_tile, but you're mentioning a list_box that is causing issues.

 

Perhaps you should print out both your DCL and your LISP

and then MATCH the KEYS of your lisp and DCL file, to make sure for each key there is either fully contained code for the key within the DCl

or, that there is a KEY that is in the LISP and DCL.....hopefully that will help you.

Once you've got your keys figured out you can process them better, that's my thinking at least.

But again it's tough to understand the exact problem you're having because of the language used to describe it.

HTH!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...