Display full version of the post: autolisp and browsing block

ademontis
02.04.2014, 14:58
Hi everybody,I have an autolisp written for Autocad 2008 on which i have used it for about 2 years without any problems...it is a lisp that browses for a block and inserts it on a pline, breaking it in the 2 contact points.The problem is... i now have loaded it on Autocad 2012 and when launched it doesn't open the 'Browse' window that normally opens when i give the command "Insert" manually.So i cannot select the block to be inserted.Any idea of what the problem could be? I attached the autolisp to the threadThanks alotAlexuploads/459382/insbreak.lsp

Kent Cooper
02.04.2014, 15:44
It looks to me as though you have several things commented out (with initial semicolons) that you shouldn't.  The only thing not commented out that sets the 'block' variable seems to be a User selection of a Block insertion, rather than a chance to navigate to find a drawing.  I think you need to relocate some leading semicolons to get the right parts of it working for you.

rs_higgins
02.04.2014, 23:06
Not sure what you are doing with this but if you give me a step by step a I should be able to correct it.It seem some steps are out of order and we an open parentheses. It looks like it was brought form an encrypted file that read it incorrectly.If so it may help to have that file.But here is a start just a quick clean up.uploads/427067/insbreak.lsp
rs_higgins2014-04-02 23:12:56

dylhunter
03.04.2014, 00:03
uploads/457050/insbreak1.lsp
 
I had updated the program. It's OK now. You can select a block on drawing, then break a line. Alos, you can select a block from files, then insert it, then break a line.

dylhunter
03.04.2014, 00:12
remember to change the path "C:/public/block/" to your path.


dylhunter
03.04.2014, 01:02
This program just run for horizontal and vertical lines perfectly. It's not good for diagonal line. It need be upgraded.

ademontis
03.04.2014, 07:51
Thank you everyone...the lisp used to work on autoCAD2008 with windowsXP 32bit, now we have autocad 2012 on windows7 64bit in the company i was wondering whether it could depend on that or on changes in the autolisp between the 2 version.It was a lisp i found on a autolisp forum for drafters and it seems that if i change the 'insert' commad to 'ddinsert' it opens the filedialog to look for the blocks but then it doesn't insert it.Associated to it there is a macro (sorry i forgot on the first post) that is: ^C^C_insert;\ins;\\\Today i will try and apply your directions, hope they help. Thank you so far.Alex

John Connor
03.04.2014, 11:17
The fact that it doesn't work has nothing to do with whether you are running the code on a 32-bit or 64-bit machine nor does it have anything to do with the OS you are running.

ademontis
03.04.2014, 11:17
[QUOTE=dylhunter]uploads/457050/insbreak1.lsp
 
I had updated the program. It's OK now. You can select a block on drawing, then break a line. Alos, you can select a block from files, then insert it, then break a line.[/QUOTE]
when i load it i get this message:Command: ; error: LOAD failed: "acadappp.lsp"

John Connor
03.04.2014, 15:16
I tested the routine using 2014 and it worked.  I did not get a load failed error.

rs_higgins
03.04.2014, 16:56
ademontisuse dylhunters version it is cleaner then the one I corrected.There is another way to load the lisp if the load did not work.I have in the past just did a drag and drop to the Drawing screen.don't know that it will work but worth the trial.