Dynamic component runtime error on MAC

I’ve spent a couple hours on my MAC, but cannot figure out why the ERROR msg “Invalid entity to animate (“X”)” occurs whenever I edit values in a previously-working animation function. Does anyone know how to avoid this situation?

Here’s how to recreate the problem:

  1. Download Sketchup’s basic animation example, i.e., Car moving along 12 inch ruler;
  2. Without editing anything, I can successfully run the example;
  3. View the ANIMATE(“X”,0,6,12) command in the Component Attributes window;
  4. Edit any non-digit character to the right of ANIMATE(", e.g., replace “X” with “X”, or remove/replace the ending parenthesis or any comma, etc.
  5. Any attempt to run the animation causes the runtime error to occur.

Re-installing the 30-day trial version of SketchUp 15.3.239 and shutdown my MAC (10.9.5) didn’t solve the issue. Any thoughts?

I’m not an expert on DC’s, but I notice that this problem goes away if I remove the quotes around “X”. For example, editing to ANIMATE(X,0,3,6,9,12) works fine on my Mac.

2 Likes

Thanks for looking into this. In the mean time, the insights (i.e., use of an animation attribute) provided by Jim Foltz’s and Wo3Dan in Feb 2015’s thread “Rotation about Y axis Problem” helped eliminate the strange editing error msg. However, even when I put quotes around the attribute (as per Wo3Dan), negative oration values around the Z axis didn’t behave well, e.g., for some reason the X axis rotates when I rotate the Z axis. I’ve even tried changing the axes, but that made matters worse. So, my basic question can be simplified as “who knows how to animate negative rotation around the Z axis?”

for us to trouble shoot the problem it is best that you upload the DC

.

He’s using this sample from the 3D warehouse:

yes, but he has continued with a query about rotation in regards to some model

Thanks for the tip. However, though I couldn’t get negative rotation values working, I just figured out a quasi-hack to achieve the affect of a bookshelf pivoting 0 to 70 degrees clockwise from its back left corner. Abbreviated steps are:

  1. Change component’s axes to lower left, back corner (Z down, X left, and Y facing backwards)
  2. Create Z rotation angle animation attribute with default value of 180: Z_Angle = 180
  3. Use OnClick command to update the attribute: ANIMATE (Z_Angle, 180, 250)
  4. Set RotZ to be the animation attribute: RotZ = Z_Angle
  5. Constrain X rotation to 180: RotX = 180

I’d be interested in a more straight-forward approach

Here’s the working code. Unfortunately, I didn’t have time to delete out the unnecessary components
SketchUp Hidden Door.skp (477.2 KB)

Nice concept

clean up by changing axis to show Z up, rotated item on X axis then deleted attribute. Formula as per Wo3Dan as mentioned before

It gives a cleaner result, however good that you try the work around to increase your knowledge,

DCs do test the mind.

You are certainly in your element
.

SketchUp Hidden Door2.skp (565.6 KB)

PS change the angle from -70 to -65, to avoid the balustrade

much more elegant; thnx!

PCMOOR: update: Your downloaded example works great; but when I type those same instructions into my original example’s component window, the original runtime error occurs again. The only way to avoid the error is to cut & paste your OnClick ANIMATE(“RotZ”,0, -70) code into my component window. very strange…

After sleeping on this dilemma, is there a particular key sequence required to enter double-quotes in Ruby within the Component Window? this could be the issue, i.e., I’m not command line editing correctly…?

The functions drop-down on the attribute dialog show the required syntax, although RotZ will preform to a certain degree, though less than “RotZ”. It appears the code is similar to to spread sheet, in that you can click cell references into cells, the “” is used similar to an absolute reference.
.The formulas or “code” we create is passed to ruby, then passed to sketchup coding, so memory management is the likely issue…

It maybe the RotZ attribute still had a previous value in a memory in Ruby and Sketchup . I have observed similar behaviour with the Material attribute on odd occasions. So editing can require a bit of rework. However one can make sure the visible values do match, like RotZ may still show 180, instead of either 0 or -70 when editing. Having said that a “reset” or rewrite of the attribute helps to remove residue memory which we cannot see. Sometimes clicking the “attribute in” reinforces the relationship to work helps

I think as amateurs we are more likely to fall victim to bugs as we experiment. Eventually we work within the parameters the code designer intended us to do.But experiment or cracking can lead to some interesting results.

I was having this same problem with SketchUp my AirBook. After considerable head scratching, I determined that, for me, the “Invalid entity to animate” error was caused by smart quotes, which are enabled by default on OS X. Try turning off smart quotes in System Preferences → Keyboard → Text → uncheck “Use smart quotes and dashes.”

3 Likes

Why are they called “smart”? “American” would be a more correct expression.

Anssi

They are called “smart quotes” because the OS selects when to use the left quote and when to use the right quote by context rather than having user type the two different characters. The left quote and right quote are different unicode from the straight quote and are not recognized by SketchUp’s parser, hence the error.

I know about the different left and right characters. I was just poking fun. People in our parts have to struggle just like you do to turn this feature off (on the Mac or in MIcrosoft Word, for instance) as it is against our typograpic conventions.

Anssi

Not-so-smart-quotes

They should be switched of UNLESS you want them…

:confounded:

Smart-quotes is still a problem in SketchUp 2016. You can either disable them or use a plain text editor to copy a quote from.