set an object as model base programmatically

Typically: "How do I... ", "How can I... " questions
Post Reply
maf
Posts: 16
Joined: 16 Jan 2023, 16:34

set an object as model base programmatically

Post by maf »

Is there an API call to flag an object as "model"? (implying this object is the model base)

I searched for long time but could not find it. There is an argument sim.modelproperty_not_model to _remove_ the model tag, but not to add it!?! (see sim.setModelProperty)

Thanks.

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: set an object as model base programmatically

Post by fferri »

Hi,

you can set an object as model by removing the sim.modelproperty_not_model bit,

e.g.:

Code: Select all

modelProp = sim.getModelProperty(objectHandle)
modelProp = modelProp & ~sim.modelproperty_not_model
sim.setModelProperty(objectHandle, modelProp)
or you can compose (with bitwise "or", e.g. sim.modelproperty_value1 | sim.modelproperty_value2) the model property value from individual sim.modelproperty_* bits (it would be 0 if none of the bits is specified, i.e. a model with all features enabled).

maf
Posts: 16
Joined: 16 Jan 2023, 16:34

Re: set an object as model base programmatically

Post by maf »

Hi, thanks for your reply.
Sorry, after long hours I must have missed it is just a bit mask... :)

Post Reply