Vector Argument Conversion

I try to multiply a vector times a float: proj_vec = dA * proj_len
I get the following error: $<ArgumentError: Cannot convert argument to Geom::Vector3d>

I check, and dA really is a Geom:Vector3d class, (0,0,1), and proj_len really is a Float class, 1.0 in fact.

My chatbot says that SU fires the error because proj_len it really a C++ point3d under the hood but I don’t believe it.
Any ideas?

The problem is that operator * is defined in Vector3d to be the cross product with a second vector. There is no operator to multiply a Vector3d by a scalar. You must use the #length= method instead.

Perfect answer. I should have know just looking at the Vector3d class documentation. And another example of AI running me down a rabbit hole. I cannot understand why people think AI will be taking jobs from people. I just don’t see the wisdom in that.

Yup, AI is wrong half the time by it’s own admission.

Also, weirdly, AI usually does not check the official SketchUp API documentation first. Often instead citing StackOverflow or this forum’s posts as gospel.

In truth, the Length class is a Ruby pseudo-subclass of Float which is a double on the C-side. FYI, the Point3d objects are a struct on the C-side holding three double values. (Same for Vector3d objects.)

AI has been wrong half the time for me which causes me to use it for only certain things. I use it for data mining. It is good at that. Programming, it is not good at. For programming, I have to THINK. Something AI is bad at. I think we should call it “DM”: data mining. Because it is not AI. I have been told that the premium versions are better. But, again, I double it. That is just a marketing tool. Marketing is the branch of business where you try to get high dollar from your customers who will yield it, and low dollar from customers who will not. Usually, the product is the same but the packaging is different.

Yeah, like they think I’ll pay after seeing their free edition fail so often? Nope.