rodrigo_sjc_sp Posted October 18, 2013 Share Posted October 18, 2013 How to insert AUTOCAD block and make the force autocad updating TAGS?? I use this command (command "insert" (strcat "*"blockwithPath) (getpoint "\nSelect insertion point: ") "1" "0" "1") Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 18, 2013 Author Share Posted October 18, 2013 When you insert the block, if he finds a new tag him of the following error "Unknown command" The insertion is ok , more the new tag does not come along with the block. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 18, 2013 Share Posted October 18, 2013 Try the ActiveX insertblock method: (vla-insertblock (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3D-point [color=green]<insertion-point>[/color]) [color=green]<block-name>[/color] 1.0 1.0 1.0 0.0 ) Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 23, 2013 Author Share Posted October 23, 2013 Lee, It did not work, even doing so it does not update the new tags, Is there any command to insert a block it updates all blocks DWG with the same name? If I have a block with name tag with the X, and then I insert a new block with name tags with the X and Y Is there any way using Lisp to insert this block and update the tags all blocks with the same name? Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 23, 2013 Author Share Posted October 23, 2013 Any help ? Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 23, 2013 Share Posted October 23, 2013 Are the two blocks named the same? You're just basically substituting the first block (with one attribute) with the second block that has two attributes right? Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 23, 2013 Author Share Posted October 23, 2013 Yes Remark, The user insert a block name BLOCK A, the block contain two attributes (A1, A2). Someone else has changed this original block by inserting a new attribute (a3) When I give the command to insert it does not update the new attribute it only appears (a1, a2). The correct result would be to insert the block, and update the new attribute (a1, a2, ((a3)) ) What I need is the following, if I insert a block existing force it to update the attributes. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 23, 2013 Share Posted October 23, 2013 Use ATTSYNC Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 Lee, run, plus it did not update the new attribute. Only created more items in properties Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 One way it can be done without using lisp. Your task is how to replicate the steps using lisp. Update a drawing with a block of the same name… 1. Open the drawing where block XYZ needs to be replaced. 2. Using Design Center (ADCENTER) navigate to the drawing file that has the updated XYZ block, and in the left window pane, expand the contents of the drawing (ie. click the "+" sign). 3. Click on the topics called BLOCKS, find the "good" block, right-click on it, and from the pop-up menu select "Redefine Only". The blocks in your current drawing should update accordingly. Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 ReMark , must be in the same LISP, it is a system that I am doing to insert blocks. Because when using the insert command, it does not update the new attributes? Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 I find it difficult to believe this problem has not been solved with a lisp routine posted somewhere on the Internet. Did you search for one? Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 I searched on google and have not found a code If you have any code I appreciate. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 If I had a code you would have had it by now yourself. What search criteria did you use? I'm continually amazed at people who say they "searched all over" and found nothing. Usually the problem is their search criteria was faulty. Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 Lisp insert block update attributes I am still researching more, only posted here because it could be someone had the hint, but I will continue searching Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 You are not inserting a block so much as you are replacing a block and that block happens to have the same name. Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 Well, I will continue to search, I appreciate the help. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 Expand your search. I found something over at The Swamp that might work. It is called Replace.lsp written by Richard D. Howard (1990) and submitted by danallen. Quote Link to comment Share on other sites More sharing options...
rodrigo_sjc_sp Posted October 24, 2013 Author Share Posted October 24, 2013 thanks for the tips Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 24, 2013 Share Posted October 24, 2013 The code is included in this thread posted at the AutoDesk Discussion Groups > Visual lisp.... forum. http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Amends/td-p/806704/page/2 I'll have to bill you for my time. Where do I send the bill? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.