Print Page | Close Window

autolisp and browsing block

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10194
Printed Date: 01.Jun.2026 at 01:20


Topic: autolisp and browsing block
Posted By: ademontis
Subject: autolisp and browsing block
Date Posted: 02.Apr.2014 at 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 thread
Thanks alot
Alex

http://www.cadforum.cz/forum_en/uploads/459382/insbreak.lsp" rel="nofollow - uploads/459382/insbreak.lsp



Replies:
Posted By: Kent Cooper
Date Posted: 02.Apr.2014 at 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.


Posted By: rs_higgins
Date Posted: 02.Apr.2014 at 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" rel="nofollow - uploads/427067/insbreak.lsp


Posted By: dylhunter
Date Posted: 03.Apr.2014 at 00:03
http://www.cadforum.cz/forum_en/uploads/457050/insbreak1.lsp" rel="nofollow - 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.


Posted By: dylhunter
Date Posted: 03.Apr.2014 at 00:12
remember to change the path "C:/public/block/" to your path.


Posted By: dylhunter
Date Posted: 03.Apr.2014 at 01:02
This program just run for horizontal and vertical lines perfectly. It's not good for diagonal line. It need be upgraded.


Posted By: ademontis
Date Posted: 03.Apr.2014 at 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




Posted By: John Connor
Date Posted: 03.Apr.2014 at 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.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: ademontis
Date Posted: 03.Apr.2014 at 11:17
Originally posted by dylhunter dylhunter wrote:

http://www.cadforum.cz/forum_en/uploads/457050/insbreak1.lsp" rel="nofollow - uploads/457050/insbreak1.lsp
 
http://www.cadforum.cz/forum_en/uploads/457050/insbreak1.lsp" rel="nofollow - 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.

when i load it i get this message:

Command: ; error: LOAD failed: "acadappp.lsp"




Posted By: John Connor
Date Posted: 03.Apr.2014 at 15:16
I tested the routine using 2014 and it worked.  I did not get a load failed error.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: rs_higgins
Date Posted: 03.Apr.2014 at 16:56
ademontis
use 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.



Print Page | Close Window