Jump to content

Recommended Posts

Posted

Hi fantastic lisp people, 

 

I have a (probably very basic) lisp question. 

I'm making a basic command to augmenting existing AutoCAD command. I would like this command to act like a vanilla command, ie. repeat on <enter> or <space>.

Is this doable? I'm fine if the answer is 'no', or 'no but you can use a "while" loop or the "repeat" command'. 

 

F.Y.I - Here's my humble lisp: 

 

(defun c:ROT1 ()
(setq selection1 (ssget))
(command "rotate" selection1 "" pause "r" "@" pause pause)

)

 

Posted

To run this command you have typed "ROT1" on the command line. If you press enter or spacebar immediately after the command is finished it will repeat. You can access your command history by pressing the up arrow which will step through the command history in reverse order, or just type "ROT1" again

Posted

Hi Dlanorh

 

It would be great if it were that simple. I wrote the command and can run it fine and all that jazz. 

My question was a bit more specific. If you press the enter key it does not repeat the command. It runs the select command - which must be the last command hidden within the 'magic' of the default rotate command? (If it does run again on your machine,  could it be possible I have different system variable setting which make the effects different?)

Posted

I just loaded your ROT1 lisp function, and it does repeat just fine using <enter> or the spacebar, in AutoCAD and BricsCAD.

Posted
2 hours ago, JWhelp said:

Hi Dlanorh

 

It would be great if it were that simple. I wrote the command and can run it fine and all that jazz. 

My question was a bit more specific. If you press the enter key it does not repeat the command. It runs the select command - which must be the last command hidden within the 'magic' of the default rotate command? (If it does run again on your machine,  could it be possible I have different system variable setting which make the effects different?)

 

Run the command on your sysytem and press the up arrow to cycle backwards through the command list. Is "ROT1" there?

Posted

Yep, "ROT1" is there in the previous commands list. 

 

The command works but i can't get it to repeat with  "space" or "enter".

 

Maybe this is a system variable thing then? You both don't have a problem with it. 

 

Here's my screen shot showing the command line until the command fails on attempting to run it again.

 

Does this shed light on anything?  

Screen_ROT1.JPG

Posted

What do the  sysvars "INPUTHISTORYMODE"  "DYNMODE" and "DYNPROMPT" give you?

Posted


INPUTHISTORYMODE <15>:
DYNMODE <3>:
DYNPROMPT <1>:

?

Posted
20 hours ago, JWhelp said:

If you press the enter key it does not repeat the command. It runs the select command

 

Sorry, but i missed this bit. If Its asking you to select again then the lisp IS repeating. Or do you mean you automatically want to select the last object again?

Posted
33 minutes ago, dlanorh said:

 

 If Its asking you to select again then the lisp IS repeating. Or do you mean you automatically want to select the last object again?

 

No. The (ssget) in the lisp which prompts the user to "Select objects:" is not the same as the SELECT command. Check the image in post 6.

Posted

@JWhelp - try this. 

Run the ROT1 command and finish it.

Then right-click in the drawing editor area, and look at the context menu.

Does it say "Repeat ROT1" and is ROT1 listed under "Recent Input"?

repeatq.png

Posted

Try running the native built-in ROTATE command. Does it fail to repeat with the space bar or <enter> also?

 

Here is someone with a similar problem, he is running the ROTATE command (which is what you lisp is doing), and then the space bar or <enter> executes the SELECT command.

It looks like an add-on is causing the issue

 

 

  • Thanks 2
Posted

rkmcswain - You are totally right! it doesn't repeat either so its not my lisp afterall! 

Thank you Doctor, I'll check out you link above now.

 

Posted

Uninstall.JPG.285a68d4c1c4b06d94bdbbd737171ffe.JPG

 

Genius! ...and i thought this was all about my dodgy scripting skills! 

Thanks very much for this one. Much appreciate everyone's help!

  • Like 1
Posted
4 hours ago, rkmcswain said:

 

No. The (ssget) in the lisp which prompts the user to "Select objects:" is not the same as the SELECT command. Check the image in post 6. 

 

I cannot see any image in post 6. Something is filtering out *.jpg in my browser. I can see the *.png and *.gif but not *.jpg. :cry:

Posted (edited)

Sorry about that! I should remeber to copy from the comand line too, in case someone has a similar problem with viewing jpegs in the future.

The image shows that after my script runs, when I press <enter> the SELECT comand runs (Not the ROT1 as expected)

My problem was caused by a third party plugin called ' DiLeader ' - which I have now uninstalled. It was supposed to create dynamic leaders with text populated automatically based on what object you were pointing at. 

It was a bit glitchy and also caused this problem - commands not repeat properly! 

All good now tho! 🙂

 

 

Edited by JWhelp
Posted
1 hour ago, JWhelp said:

Sorry about that! I should remeber to copy from the comand line too, in case someone has a similar problem with viewing jpegs in the future.

The image shows that after my script runs, when I press <enter> the SELECT comand runs (Not the ROT1 as expected)

My problem was caused by a third party plugin called ' DiLeader ' - which I have now uninstalled. It was supposed to create dynamic leaders with text populated automatically based on what object you were pointing at. 

It was a bit glitchy and also caused this problem - commands not repeat properly! 

All good now tho! 🙂

 

 

Thanks for the update. My problem has been solved by a browser update. It found a corrupt file.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...