run lisp, script or Macros to select objects without interactiving with AutoCAD

run lisp, script or Macros to select objects without interactiving with AutoCAD

michaelZCXYL
Enthusiast Enthusiast
2,189 Views
35 Replies
Message 1 of 36

run lisp, script or Macros to select objects without interactiving with AutoCAD

michaelZCXYL
Enthusiast
Enthusiast

Hello,

 

I am wondering if anyone can answer the below question,

How to avoid to interactive with AutoCAD to run lisp, script or Macros to select objects, for example, revision clouds, circle, block, thank you very much in advance.

0 Likes
Accepted solutions (2)
2,190 Views
35 Replies
Replies (35)
Message 21 of 36

michaelZCXYL
Enthusiast
Enthusiast

see below, thanks, 🙂

0 Likes
Message 22 of 36

michaelZCXYL
Enthusiast
Enthusiast

Sorry about it, this is my final request list,

 

1. create new layer "clouds", move clouds to clouds layer, freeze clouds layer.

2. handle multiple drawings at one time

 

Thank you very much. 🙂

0 Likes
Message 23 of 36

ronjonp
Advisor
Advisor

@Sea-Haven wrote:

Yes can be added, but take a step back and think about what you want past this new request, its frustrating just getting please add this multiple times. Ronjonp is helping you I am sure he would prefer the full request list.


@Sea-Haven  Yes, someone that can fully ask a thorough question is always appreciated but there seems to be a language barrier which is not uncommon. Agreed it's frustrating ....

0 Likes
Message 24 of 36

michaelZCXYL
Enthusiast
Enthusiast

So far is good enough, is it possible to make the following changes? 
create a new layer "A", move clouds to A layer, freeze or off A layer.
Sorry about it. next time, I will make sure to present my questions clearly and ask my colleague/friends to check them, thanks. 🙂

0 Likes
Message 25 of 36

ronjonp
Advisor
Advisor

@michaelZCXYL wrote:

So far is good enough, is it possible to make the following changes? 
create a new layer "A", move clouds to A layer, freeze or off A layer.
Sorry about it. next time, I will make sure to present my questions clearly and ask my colleague/friends to check them, thanks. 🙂


Make these changes to the code in the first part of the thread and you'll get your frozen layer 'A'.

ronjonp_0-1651253519288.png

 

 

Message 26 of 36

michaelZCXYL
Enthusiast
Enthusiast

It works, great job! Can I use "off" instead of "freeze"? Many thanks. 

0 Likes
Message 27 of 36

ronjonp
Advisor
Advisor

@michaelZCXYL 

Lets see if you can figure it out. HERE is your reference .. drill into the LAYER object, then look at properties. Values to set: 0 = :vlax-false, -1 = :vlax-true.

 

Let me know how it goes 👍

Message 28 of 36

michaelZCXYL
Enthusiast
Enthusiast
Accepted solution

Hello Ronjonp,

 

I am very happy to learn new stuff. As I am a little busy right now, I will try to figure it out later. There is one more question in another post, I am wondering if you are interested in it, thank you very much.

 

Have a good weekend,

 

Michael 🙂

0 Likes
Message 29 of 36

michaelZCXYL
Enthusiast
Enthusiast

I have accepted your solution, thanks. 🙂

0 Likes
Message 30 of 36

ronjonp
Advisor
Advisor

@michaelZCXYL wrote:

I have accepted your solution, thanks. 🙂


Actually you've accepted your solution? 🤔

0 Likes
Message 31 of 36

michaelZCXYL
Enthusiast
Enthusiast

It is a mistake, sorry about it. Could you please advise me how to accept your solution? Also, I am wondering if you can add the following part in the beginning,

 

set the current layer to 0,

 

Thank you very much in advance, 🙂

 

 

0 Likes
Message 32 of 36

ronjonp
Advisor
Advisor

@michaelZCXYL wrote:

It is a mistake, sorry about it. Could you please advise me how to accept your solution? Also, I am wondering if you can add the following part in the beginning,

 

set the current layer to 0,

 

Thank you very much in advance, 🙂

 

 


To accept the solution you have to go HERE then accept. As far setting layer 0 current, simply add this to the code at the top: (setvar 'clayer "0")

Be advised his will error if layer 0 is frozen.

0 Likes
Message 33 of 36

michaelZCXYL
Enthusiast
Enthusiast

Great, it works. I have accepted your solution and hope I did it right this time. I have another question in another post, I am wondering if you are interested in it? Thank you very much in advance. 🙂

0 Likes
Message 34 of 36

Kent1Cooper
Consultant
Consultant

@ronjonp wrote:
.... As far setting layer 0 current, simply add this to the code at the top: (setvar 'clayer "0")

Be advised his will error if layer 0 is frozen.


It will also have a problem if Layer 0 is turned off -- it will set it current, but it will not turn it on.  So I suggest this:

(command "_.layer" "_thaw" "0" "_set" "0" "")

which will take care of the possibility that it's frozen, and in the process of setting it current by the (command) approach will turn it on if it's off [unlike the (setvar) approach] -- no need for an explicit "_on" option.

Kent Cooper, AIA
Message 35 of 36

michaelZCXYL
Enthusiast
Enthusiast

Hello,

 

I find a another different lisp, it work on multiple drawing at one time. I am wondering if you are interested in combing your FOO lisp with that one. I may create another post for this question, thank you very much in advance.

0 Likes
Message 36 of 36

michaelZCXYL
Enthusiast
Enthusiast

Hello Kent. I just saw your message. Is Your suggestion script, could you please write in lisp? Thanks 

 

@ronjonp Hello Ronjonp, I have one more question. The lisp work on the clouds which I just created, but it did not work on existing clouds, could you please provide some advice to me, many thanks.

0 Likes