3d text appears to ignore z parameter

Actually the GUI, places the 3Dtext primitives within a component. The API does nothing, but create the primitives within the current active_entities context. So it is up to you, whether you want it in a component or group.

When the API doc says “origin” it refers to the origin of whatever context you place it in. This could be a new group you’ve just made. Or some other existing group or component,… might be nested, etc.

After creating the context (group or component,) for your 3DText, apply a transformation to move it, rotate it, scale it, whatever. So, just like the GUI command, the transformation (insertion point,) is not really set until the last step.

Re. groups vs components, you can always use the group#to_component() instance method. But in this case, if you want it a component, you might as well just do that from the start.

text = "Some text for my component"
defn = model.definitions.add(text)
# now defn's name is equal to the text,
# an appears in the EntityInfo dialog (nifty!)
defn.entities.add_3d_text(
  text, TextAlignLeft, "Arial",
  true, false, 1.0, 0.0, 0.5, true, 5.0
)
# create a transform for the text
t = Geom::Transformation::new( x, y, z )
# now place an instance where you will:
model.entities.add_instance( defn, t )

You definitely always want to put 3DText in a container of it’s own. If you prefer group:

text = "Some text for my component"
ents = model.active_entities
cpt = ents.add_cpoint([0,0,0])
grp = ents.add_group(cpt)
grp.name= text
# now defn's name is equal to the text,
# an appears in the EntityInfo dialog (nifty!)
grp.entities.add_3d_text(
  text, TextAlignLeft, "Arial",
  true, false, 1.0, 0.0, 0.5, true, 5.0
)
# create a transform for the text
t = Geom::Transformation::new( x, y, z )
# Now move the group where you will, ...
# relative to the active entities context's origin
grp.transform!( t )

You can erase the cpt but it may come in handy later for the user if they wish to move the text.