Selecting Drawing Objects from Script (or via Command Line)

Selecting Drawing Objects from Script (or via Command Line)

Wojty1
Advocate Advocate
1,816 Views
2 Replies
Message 1 of 3

Selecting Drawing Objects from Script (or via Command Line)

Wojty1
Advocate
Advocate

Hi folks!

 

I wonder if it is possible to select Objects without using the mouse or buttons etc.

 

Currently I am working on some scripts to automate our daily work and save some time.

Most steps are quite easy to find out by just playing around and later check the commands used in the Command Window by pressing [Ctrl]+[F2], but when it comes to selecting the right objects without user interaction things are getting seriously mad.

 

Let's say I have a bunch of commands and somewhere in between I need to select specific objects that need to be processed. I could select everything with the ALL parameter, but unfortunately there is no command-line version of the Quick Select Command which would come in very handy.

I spent a lot of time watching tutorials, reading topics and step-by-step instructions, but nothing comes close to what I actually need.

 

Well, with AutoLISP or VBA this can surely be done, but I need it to be a Script.

More precisely I need the script to select all COGO Points (which are special Civil 3D Objects) and process them.

 

Having a command-line Quick Select I would simply write something like "-QSELECT COGOPOINTS LAYER MyLayer" to get all the COGO Points on Layer "MyLayer".

 

I there any command that will get this job done?

 

Any help appreciated.

Windows 10 Pro 64-bit | Civil 3D 2024+2025 / Revit 2024 (64-bit EN)
Intel Core i7-7700K / 2x 27" / 64 GB RAM / GeForce RTX 3060 OC V2

Windows 11 Pro 64-bit | All Autodesk Products 2023 - 2025
Intel Core i7-13850HX / 3x 27" / 128 GB RAM / nVidia RTX Ada 3500
0 Likes
1,817 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant

Hi,

 

", but I need it to be a Script"

You can use Lisp and VBA in your commandline 

so you can use it in a script .scr too 😉

Script doesn't mean "no Lisp" or "no VBA"

 

 

Sebastian

0 Likes
Message 3 of 3

paullimapa
Mentor
Mentor

As @cadffm pointed out in his reply, is there a reason to avoid including Lisp code within a script?

The following lisp code placed in a line of script would select all cogo points on your specific layer:

(setq ss (ssget "_X" (list (cons 0 "AECC_COGO_POINT")(cons 8 "Mylayer"))))

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes