New API doc - typos and questions
-
It doesn't mention how to allow drop-down options by using a third array with strings separating each option with a pipe | character.
-
You can do a dropdown box?
-
UI.inputbox ['Hello'], ['World'], ['Mars|Pluto|World|Monkeys'], 'Title'
"Global Material Changer" and "Component Spray" uses it. That's the only way I knew it was possible.
-
@chris fullmer said:
You can do a dropdown box?
Sure, and I made this to ease the pain a little: http://sketchuptips.blogspot.com/2008/03/inputbox-class.html
-
Nice one Jim.
-
http://code.google.com/apis/sketchup/docs/ourdoc/point3d.html#z=
It says:
Point3d.z= The y= method is used to set the z value of a 3D point.
That second line should say "The z= method..."
-
Face.area
actually takes an optional argument. I'm not sure what the argument is. It accepts pure numbers which then seems to be a scale factor. But it also acceptsTransformation
objects. -
Same applies to
Edge.length
-
Point3d.project_to_plane
The example uses project_to_lineplane = [Geom;;Point3d.new(0,0,0), Geom;;Vector3d.new(0,0,1)] point = Geom;;Point3d.new 10,10,10 projected_point = point.project_to_line line
-
Tool - onMouseMove example has a bad local variable.
http://code.google.com/apis/sketchup/docs/ourdoc/tool.html#onMouseMovedef onMouseMove(flags, x, y, view) puts "onMouseMove; flags = " + key.to_s puts " x = " + x.to_s puts " y = " + y.to_s puts " view = " + view.to_s end
The variable "key" should be replaced with "flag" I think. That makes the example work.
Chris
-
http://code.google.com/apis/sketchup/docs/ourdoc/face.html#get_UVHelper
The code example:
model = Sketchup.active_model entities = model.active_entities pts = [] pts[0] = [0, 0, 0] pts[1] = [9, 0, 0] pts[2] = [9, 9, 0] pts[3] = [0, 9, 0] # Add the face to the entities in the model face = entities.add_face pts tw = Sketchup;;TextureWriter.new uvHelp = face.get_UVHelper true, true, tw
This will return the error:
@unknownuser said:
Error: #<TypeError: (eval):95:in `get_UVHelper': wrong argument type (expected Sketchup::TextureWriter)>
(eval):95Instead of
tw = Sketchup::TextureWriter.new
, the methodtw = Sketchup.create_texture_writer
will work.
Which leads to another questions: why can'ttw = Sketchup::TextureWriter.new
be used as in the example? -
ModelObserver.onPlaceComponent
http://code.google.com/apis/sketchup/docs/ourdoc/modelobserver.html#onPlaceComponentThe manual claims that a
Model
is passed on as the argument, but instead it's theComponentInstance
. I have not tested the rest of theModelObserver
events to see if they also match.onPlaceComponent FIXED
-
@thomthom said:
ModelObserver.onPlaceComponent
http://code.google.com/apis/sketchup/docs/ourdoc/modelobserver.html#onPlaceComponentThe manual claims that a
Model
is passed on as the argument, but instead it's theComponentInstance
. I have not tested the rest of theModelObserver
events to see if they also match.Thomas, you rock.
I'll double check all of the modelobserver arguments. Thanks!
-
For
Point3d.distance_to_line
the docs give the same example aspoint3d.distance
. -
I can't get the
DefinitionObserver
to trigger at all. http://code.google.com/apis/sketchup/docs/ourdoc/definitionobserver.html Neither theonComponentInstanceAdded
oronComponentInstanceRemoved
events. Are these the correct event names? -
I just had a big one reported to me... posting it here so folks are aware until the next fix.
The face.material method is entirely missing from the new docs.
-
There's a new update live that fixes (most of) the problems reported above. There were one or two that will require me to pound on it a bit more. Keep 'em coming!
I also posted a new tutorial on reading attributes.
-
Nice one Scott.
I seem to have come across three observer events that doesn't work. It would probably be useful to mark these in the docs with a warning so that people won't waste a whole lot of time trying to get them work work. ..like I have...
DefinitionObserver
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17631 (Completely busted)
EntitiesObserver.onContentsModified
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17970 (Add and Remove event works though. Haven't tried the Erase event.) -
I also just got this one from a coworker:
Sketchup.get_resource_path example fails. Looks like there's a required parameter that's not properly documented.
-Scott
-
These failing observers is quite severe. I don't suppose there's a chance the dev team can push out an update outside the servicepack schedule? (I don't know what your schedule is, but seeing that we just got an servicepack I'm a bit pessimistic to when this might be addressed...)
Advertisement