Search the Community
Showing results for tags 'autocad programming'.
-
lisp Calling Command from loaded .VLX file into external .LSP routine
samehhosny posted a topic in The CUI, Hatches, Linetypes, Scripts & Macros
Good day Everyone, I have an old topic here where I wanted to visualize my lisp routines into drop down menus. I have succeeded in developing an excel sheet to automate the process of adding and removing items into my menus without any hassle or any typing mistakes. However, I am stuck in a small portion of my lisp routines where I would like to call a specific command loaded from a .VLX file into my big .LSP routine. To be more clear, I have the following setup: Excel Sheet has all my data with all commands with their relative routines needed to exist in mylisp.lsp Same excel sheet has the hierarchy of the drop down menu. Each menu item is connected the commands above by calling the command with a simple macro. So far, all my lisp routines consists of native autocad commands which I do not face any issue with them so far. Last menu with last set of lisp routines should consist of simple and native commands combined with an external command loaded from .VLX file. every time I try to include this command loaded from the .VLX into another .LSP file, it can not be loaded and I can not pass any parameter to it as well. Let me show simple example: This is the routine which includes only native autocad commands: BlockName contains 7 different attributes (Some Text). (DEFUN C:EBMSS () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" ) (COMMAND "LAYMCH" "L" "" "N""ITEM")) Same lisp routine with added the last command which is loaded from the VLX file. It does not work. (DEFUN C:K0 () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text") (COMMAND "LAYMCH" "L" "" "N""ITEM") (COMMAND "BLOCKC" "L" "R" "0" "PREFIX TEXT" "SUFFIX TEXT")) ;This command is executed from loaded .VLX file. FYI, I do not have access to the source code and I do not need to. All I need is to be able to initiate the command into the lisp routine to auto select the last added block with some attributes and passing some arguments to it. I wish if anyone can help me achieving this target. By the way, I am developing these programs to help me and my teammates speeding up the work progress at our design office. Thanks in advance and wish you all a wonderful day. Regards, Sameh Hosny