How to avode double selection

How to avode double selection

danglar
Advocate Advocate
3,644 Views
32 Replies
Message 1 of 33

How to avode double selection

danglar
Advocate
Advocate

I did a little improvement of code from

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-make-selection-set/m-p/840402...

in order to add text mask from express tools (c:textmask) and now routine can draw background wide polyline under selected polyline and also create text mask under selected text.

Program working properly but have "dirty" limitation. User need to make double selection: one for text mask and another one for polylines (see attached lisp)

I tried to change it but it was unsuccessful and one of the reasons of it I can't call needful sub functions from (c:textmask)

Is it possible to automate process and make "one shot selection" for these subroutines

Any help will be very appreciated

 

0 Likes
Accepted solutions (1)
3,645 Views
32 Replies
Replies (32)
Message 21 of 33

danglar
Advocate
Advocate

I decided to use Lee Mak Burst routine instead of explode option (see attached lisp)

I also did a little "cosmetic" changes and in this case we don't need to clean the "garbage"

program working very fast because used exploded items (thanks for good idea)

Program on this stage meet my needs

Thank you soo match for your efforts 

Without your help I couldn't achieve the goal 

0 Likes
Message 22 of 33

ВeekeeCZ
Consultant
Consultant

Here is the version with Lee's burst routine.

0 Likes
Message 23 of 33

ВeekeeCZ
Consultant
Consultant

@danglar wrote:

Thanks again   

for your efforts. Now we are very close to final solution of this issue.

It's took me a couple of hours to check deeply your approach an find some limitations

1. In a case of "Contour" in blocks selection sub routine program functionality become very slow and even Couse to autocad to stop working (not responding issue)

My suggestion to eliminate "Contour" sub function at all - it's unnecessary

2. It's a clever thing to clean the "garbage" (I mean after blocks, dimensions and leaders exploding)

probably will be better to use (c:burst) express tools function in order to convert attributes to text entities?

probably this approach can be useful for "cleaning" and "drawordering" in a same time

(defun c:drb ( / i s )
    (if (setq s (ssget "_X" '((8 . "0-BACKGROUND"))))
        (command "draworder" s "" "b")
    )
    (princ)
)

(defun c:er0 ( / i s )
    (if (setq s (ssget "_X" '((8 . "0"))))
        (command "_erase" s "")
    )
    (princ)
)


(defun c:dro ( / )
(setq oldclayer (getvar "clayer"))
(c:drb)
(c:er0)
(command "regenall")
(setvar "clayer" oldclayer)
)

Your opinion is very important for me

 


 

Don't add anything of the above code to the routine. All is already covered. My routine does not leave any 'garbage', as far as I know.

Lee's BURST routine makes the sense. I didn't like the Contour routine from the start. Very slow and unreliable to use in mass.

*LEADER and DIM still have to be EXPLODEd because Lee's BURST does not handle them.

0 Likes
Message 24 of 33

ВeekeeCZ
Consultant
Consultant

@ВeekeeCZ wrote:

...My routine does not leave any 'garbage', as far as I know....


 

Sorry, you are right, that too conceited from me. I didn't think that EXPLODE can return anything, so there can be some leftovers. I expended the ss filter for the ERASE command. 

0 Likes
Message 25 of 33

danglar
Advocate
Advocate

Thanks again for your efforts                        

Now your approach working match faster than my..

Because your approach I tried to think deeply about leaders and dimensions

and I find some limitations when routine make a background mask under these entities

Obviously program "missing out"  arrow solids of exploded dimension and leaders and it's because of this part of code

(if (setq sst (acet-ss-ssget-filter ss '((0 . "SOLID"))))
	(command "_.ERASE" sst ""))

I think will be better to create outline around of solids and than to erase it..

 

This step will take opportunity to create background mask under outlines and "complete the mission"

What's your opinion about this approach?

0 Likes
Message 26 of 33

danglar
Advocate
Advocate

this approach modified by me (see attached lisp) can be helpful for this purposes

 

0 Likes
Message 27 of 33

danglar
Advocate
Advocate

.. mach simpler and faster

0 Likes
Message 28 of 33

danglar
Advocate
Advocate

… finally something like this (see attached approach)

Smiley Happy

0 Likes
Message 29 of 33

ВeekeeCZ
Consultant
Consultant

Seriously, this makes sense to you?! Oh c'mon, you gotta be better than this!

 

      (if (setq sst (acet-ss-ssget-filter ss '((0 . "SOLID"))))
	  (c:so)
	(command "_.ERASE" sst ""))

 

 

; -----------------

The second routine you've found is the right direction, but poor one... I made a better and even faster version of my own.

 

Just one note, If possible would you keep the main routine the very first thing in a file? 

0 Likes
Message 30 of 33

danglar
Advocate
Advocate

Actually, it's not make sense for me so so, but it was a very fast and "dirty " solution only for drawing principal lines of final solution. From the other point of view.. Lets' imagine draft drawing for price estimating only with very BIG dimensions and this solution becomes actual

You are right. More clever to put the main routine as the very first thing in a file

Thanks again for elegant solution!

 

0 Likes
Message 31 of 33

ВeekeeCZ
Consultant
Consultant

@ВeekeeCZ wrote:

Seriously, this makes sense to you?! Oh c'mon, you gotta be better than this!

 

      (if (setq sst (acet-ss-ssget-filter ss '((0 . "SOLID")))) ; IF the ss contains some solids,
	  (c:so)  ; THEN run the (c:so)
	(command "_.ERASE" sst ""))  ; ELSE erase... ERASE WHAT? 

 


I meant... I didn't question the (c:so) function itself, whether is suitable or not, but the logic of the code of yours!

 

0 Likes
Message 32 of 33

danglar
Advocate
Advocate

my mistake.. solids on this stage already disappear..Smiley Sad

it's eliminated by (c:so)

He who makes no mistake, does nothing and Error is a best discipline through which we advance

0 Likes
Message 33 of 33

ВeekeeCZ
Consultant
Consultant

Sure. Don't get me wrong, I don't judge you. All I wanted was to challenge you to think about it once more to understand that simple logic nonsense.

0 Likes