Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Vector or not vector ?
thierry_malet
✭✭✭
Hello, i would like to make an simple cuboid with coordinate of a selected point,
i copy code from an "mesure value" FS existing code and i just reused a little part of it
but i don't know why "result" .value know as vector couldn't replace a vector(x,y,z) ?
https://cad.onshape.com/documents/fda00c1195e7580861511e84/w/3daf66389302de733d5dd7c7/e/b8d7fb7c4e612cd57d17307b

i try "corner1" : Vector (result)*millimeter, but didn't work

but when i look result should be a vector

Could you help me


i copy code from an "mesure value" FS existing code and i just reused a little part of it
but i don't know why "result" .value know as vector couldn't replace a vector(x,y,z) ?
https://cad.onshape.com/documents/fda00c1195e7580861511e84/w/3daf66389302de733d5dd7c7/e/b8d7fb7c4e612cd57d17307b
i try "corner1" : Vector (result)*millimeter, but didn't work

but when i look result should be a vector

Could you help me
0
Comments
-
On my phone so can't dig into details but I think you should be able to use "result" directly for corner 1 as it already has length units. What you have there looks like it would be length^2...2
-
Had a quick look from the office this morning:
This gets rid of the error as expected since "result" already has length units.fCuboid(context, id + "cuboid1", { "corner1" : result,//vector(result)* millimeter, "corner2" : vector(1, 1, 1) * definition.myLength });As a side note, "corner2" has to be the "absolute" coordinates so what you currently have does weird stuff. I'm guessing what you were going for would be achieved with something like this:"corner2" : result + vector(1, 1, 1) * definition.myLength
1 -
Thanks, it's simply !!
i thought i had tried this combination, but sometime when "my.length" create an 0 mm edge for cuboid, feature failed, 0 -
Not exactly what you asked, and may not apply here, but sometimes it's easier to just make an object on the origin, and use opPattern() or opTransform() in a loop to copy it all over the place, instead of trying to calculate the corner vectors for each fCuboid().1
-
opPattern all day long.Senior Director, Technical Services, EMEA0



