Roy_043 Posted December 9, 2017 Share Posted December 9, 2017 @maratovich: If there are attributes that cannot be sorted using their tag names I would try sorting them by their insertion points. Quote Link to comment Share on other sites More sharing options...
Grrr Posted December 9, 2017 Share Posted December 9, 2017 IMO sorting by handles would be better. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 9, 2017 Share Posted December 9, 2017 @Grrr: I don't understand. Wouldn't that result in a list with the same order as (vlax-invoke obj 'getattributes)? Quote Link to comment Share on other sites More sharing options...
Grrr Posted December 10, 2017 Share Posted December 10, 2017 @Roy, my mistake - sorry. Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 10, 2017 Author Share Posted December 10, 2017 Here is another variantThis is not a lisp is a program Hi Maratovich, This is truely amazing ! Is it possible to have a lisp version of this program? Because I have 5000+ combined blocks like this, this program can only select one at a time If possible I would like to modify a little bit, those 5000+ blocks are in different layers, I can "qselect" all of them easily by layer names. Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 10, 2017 Share Posted December 10, 2017 Good afternoon nosscc. Processing all the blocks requires a lot of refinement of the program. I am now very busy with commercial orders. Write me a personal message, discuss the possibility. Mail or Skype. Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 10, 2017 Author Share Posted December 10, 2017 Maratovich what is your email address ? Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 11, 2017 Share Posted December 11, 2017 Look at the contacts on the site (link in the program) Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 12, 2017 Author Share Posted December 12, 2017 Alan H is the guy in the code you provided to select text within polygon BIGAL I think with your brilliant getboundingbox method I have succeeded, now I am able to select a number of blocks, then run lisp, and will split them also rename tags for the 1st and 2nd attributes within each new block But I am having a new problem now and driving me crazy, the code I wrote seemed only working for a limited number of blocks, it is not working properly for a larger selection In this sample drawing attached, there are 68 blocks, if I apply lisp for smaller selection at a time, it worked well But if I select all blocks together, and run lisp, sometimes it gives error :function cancelled, sometimes it split all the blocks in a weird way, like grouping the 2nd attribute of the top rectangle with the 1st and 2nd attributes of the bottom rectangle This is so weird, how is this possible ? BSPLIT.LSP 68blocks.dwg Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 12, 2017 Share Posted December 12, 2017 @nosscc: Your original post is actually confusing. You also want to handle attributes that are not enclosed in a rectangle. Your last dwg shows the most tricky case so far: at least one attribute ("DA2") is located in the 'wrong rectangle'. Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 12, 2017 Share Posted December 12, 2017 Roy_043 Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 12, 2017 Share Posted December 12, 2017 @maratovich: Not sure what your point is. The only solution I can now come up with is to count the polylines in the block definition and to divide the attribute list based on that number. But creating a new separate block definition for each rectangle seems ill-advised. IMO it would just create a new problem. Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 12, 2017 Share Posted December 12, 2017 I said at the beginning that there will be different blocks and different attributes. The initial sample file does not correspond to what the topic author wants. We need to look for a solution for a long time, and take into account all variants of the author. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 12, 2017 Share Posted December 12, 2017 @maratovich: A solution as demonstrated by your animation would not be acceptable IMO. Replacing the original insert with 6 different but almost identical blocks makes no sense. Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 12, 2017 Share Posted December 12, 2017 Yes, I fully agree with you. It was a solution for one block. The rest must be thought for a long time. Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 13, 2017 Author Share Posted December 13, 2017 I think those extra attributes do not matter, if you look at the code I wrote BSPLIT, which will burst the block first, after that DA, Page numbers, etc are gone, and you will only have 2 texts left within each polygon My question is, why the lisp I wrote only works for a small selection of blocks, but not working properly/returns error for larger selection ? Is that a system bug or something ? Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 13, 2017 Share Posted December 13, 2017 @nosscc: I have not tested your code, but two things stand out: 1. OSMODE issue Read this: http://www.cadtutor.net/forum/showthread.php?102290-Multi-leader-Export-Problem&p=694644&viewfull=1#post694644 And/or: https://www.theswamp.org/index.php?PHPSESSID=10qijkpvecscg6v1uu29sdf3f6&topic=53652.0 2. Ssget issue Since you are using (ssget "_W" ...) which will only select entities that are on-screen, make sure to _Zoom _Extents before using your code. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 13, 2017 Share Posted December 13, 2017 (edited) Roy+043 If using ssget "_W" it may be better to use a Z C option and zoom out to a desirable scale rather than extents, some other screwy stuff may start to occur bit like the osmode problems as the lisp can not see what its trying to retrieve. Have had those problems before. Maybe a bounding box of the original block then a zoom c then a burst this way zooms to each block but not each pline inside. fixes and suggestions at start (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) at end (setvar 'osmode oldsnap) (setq ss (ssget (list (cons 0 "Insert")))) ;manually create a selection containing all blocks ; can use (8 . "layername") (2 . "blockname") as well pick a block 1st and get these two extra bits of info. (while (< cntr (sslength ss)) (setq obj (ssname ss cntr));retrieve nth entity name in global set ;manually create a selection containing all blocks ; uses repeat loop and if no ss does not run ; use a alert and say (exit) to do again (if (setq ss (ssget (list (cons 0 "Insert")))) (repeat (setq cntr (sslength ss)) (setq obj (ssname ss (setq cntr (- cntr 1)))) ;retrieve nth entity name in global set last to 1st Edited December 13, 2017 by BIGAL Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 14, 2017 Author Share Posted December 14, 2017 Thanks guys, you are correct. I tested it is zooming issue, not number of entities. I selected only 1 entity, worked fine when the block is "big" on my screen, 4 attributes split into 2 - 2 (2 in each block) Then same entity I selected again but zoomed out, the lisp split 4 attributes into 1-3 (the 2nd attribute in the top rectangle became grouped with 1st and 2nd attributes in the bottom rectangle) Then I tested again, but zoomed out even further, the lisp grouped 4 attributes into 1 block only, and returned error I will try to add "zoom" in the code and see how it goes Quote Link to comment Share on other sites More sharing options...
nosscc Posted December 14, 2017 Author Share Posted December 14, 2017 So far so good, I only added one line (command "zoom" "W" minpt maxpt) ;between "burst" and ssget "W" I think there is no need to zoom out, as the next loop will take my screen to the window of the next block 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.