You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sketchup.sendAction(“editUndo”)
Error:
#<NameError: undefined local variable or method `“editUndo”' for main:Object>
<main>:in `<main>'
SketchUp:in `eval'
=> nil
Sketchup.sendAction("editUndo:")
Error:
#<NoMethodError: undefined method `sendAction' for Sketchup:Module
Did you mean? send_action>
<main>:in `<main>'
SketchUp:in `eval
Run Sketchup.send_action("editUndo:") – it correctly triggers undo.
Suggested Fix:
Update the documentation to use Sketchup.send_action("editUndo:") and Sketchup.send_action("editRedo:"), ensuring correct method names, colons, and quote marks.
The text was updated successfully, but these errors were encountered:
Aside from the documentation issues, please avoid Sketchup.sendAction if possible. It's an API we should have marked deprecated a long time ago.
I think since Sketchup.sendAction is not a valid method and raises a NoMethodError (checked back to SU2016), there's no need to worry about deprecating it - it simply doesn't exist.
Could you clarify why Sketchup.send_action should be avoided? Is it due to potential future deprecation, instability, or another reason? I'm currently using send_action for simple tool selections, like Sketchup.send_action('selectMoveTool:')
Edit: I found your comment on that #542 (comment) . Now I get it.
Bug Report: Incorrect
sendAction
Command and Quote Marks in DocumentationIssue:
Sketchup::ModelObserver#onTransactionUndo & #onTransactionRedo
The documentation incorrectly suggests using:
Issues:
sendAction
is outdated; the correct method issend_action
.:
) at the end.“ ”
) are incorrect for Ruby; they should be standard double quotes (" "
).Correct Usage:
Steps to Reproduce:
Sketchup.sendAction(“editUndo”)
– Error.Sketchup.send_action("editUndo:")
– it correctly triggers undo.Suggested Fix:
Update the documentation to use
Sketchup.send_action("editUndo:")
andSketchup.send_action("editRedo:")
, ensuring correct method names, colons, and quote marks.The text was updated successfully, but these errors were encountered: