I'm trying to automate selecting all the previous objects.
If I type SELECT and enter P, this works. But when I put that into a LISP, it doesn't keep the selection. What am I doing wrong? Thanks
(DEFUN C:SEL ()(COMMAND "SELECT" "P")(PRINC))
Solved! Go to Solution.
Solved by Ranjit_Singh2. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
That worked. Thanks, BeekeeCZ! I wasn't familiar with PSELECT.
Solution:
(DEFUN C:SEL ()(COMMAND "PSELECT" "P")(PRINC))
It is upsetting to see how you are so underpowered both at work and at home.
Your dual 29" monitors must eat up all your desk space too. 😕
You should consider hooking up to your 70" LED TV with an HDMI-AWD cable.
John F. Uhden
They're 30" monitors, not 29".
And just think, all that extra power so I can run this LISP .000000001 times faster!
John F. Uhden
What is the advantage of using ssget over pselect?
John F. Uhden
Thanks for the additional info. My LISP knowledge is very basic, so I think pselect will work fine for me. Autodesk puts those commands in there for people like me who don't really know what they're doing.
If they ever change it, and I miss the release documentation on it, I'll come back here and bug you and you can remind me how wrong I was.
John F. Uhden
@nrz13 wrote:
... My LISP knowledge is very basic, so I think pselect will work fine for me. Autodesk puts those commands in there for people like me who don't really know what they're doing...
Well said. Glad that someone shares the same thinking.
I have and use hundreds of these kind of simple shortcuts, the one you've written now is between them as well.
(defun c:SS () ;Pre-select previous selection set (command "_.PSELECT" "_P" "") (princ) )
The only difference is, that your routine leave the selection open to possibly add other object to the selection or you need to hit enter to close it, but my not. Not sure if that behavior was intentional from you -- you may add the red quotes in case it was not.
Enjoy your couple of secs per a year you spared...
And what is when command PSELECT is not available?
If someone use undocumented/hidden command "PSELECT" (menumacro script command sendcommands..), make sure that pselect is available.
for your S::STARTUP
(if (not(member "acopm.arx" (arx))) (arxload "acopm.arx")) ; if acopm is not available you have bigger problems with your profile.
@cadffm wrote:
If you start acad with a profile/workspace in that the propertie palette is set to OFF.
The acopm.arx is load by this palette.
Still unable to confirm that. Using C3D 2016 as Autocad, ACAD profile, in CUI is the current profile set the "show properties" palette option to NO. Yet, I can run PSELECT without need to load it.
Another way to fix the SELECT command behavior under LISP -- and possibly cleaner way to do that than using "undocumented" command -- is to use the predecessor (initcommandversion) which forces the LISP version of certain command to act as same as autocad's version.
(DEFUN C:SEL () (initcommandversion) (COMMAND "PSELECT" "P")(PRINC))
Thanks, BeekeeCZ. I did have the end quotations in there when I first set it up using SELECT, but when that wasn't working I had taken them out. They're back in there now.
And it's already saved me a hassle programming this in because I was doing a lot of repetitive stuff the other day going through a number of drawings. I used this every other command. Also, I would use SS for the keyboard shortcut, but that's already set to SPLINE, which I normally use more often. I'm running out of 2- and 3-key combinations I can enter with my left hand only that make any sense.
Yes, C3D is not equal to AutoCAD (you start your Product as "C3D" and not as "ACAD" (startup switch /product ),
only starting with a Profile named "AutoCAD" is not the same) C3D loads "acopm.arx" for others things.
Another example for the difference between ACAD and "C3D as Acad" is,
C3D will every time add the Supportpath "C:\program files\autodesk\autocad 2017\map\bin\fdo" to your Profile
and some things more.
Unload the arx and you will see. In plain AutoCAD the arx is not loaded (when properties palette is off).
Thanks for that point, @cadffm. I always have the Properties palette open on this computer, so I had not noticed that but, indeed, the command fails to run if the Properties palette is not open. Using @Ranjit_Singh2's solution instead.
Solution:
(defun c:sel ()(sssetfirst () (ssget "_p"))(princ))