Jump to content

newbie: object name from dop id


riviera

Recommended Posts

Hi,

I'm completely new to DOP networks, so forgive the very basic question (I did look through the manuals/previous topics, though :))

To put it short: what I'd need is a function to get the name of the object in a dopnet, based on its objid.

What I'm trying to achieve is that I have four toruses (torii?) and four spheres (called torus_<n> and sphere_<n>), which are all rbd objects. I want to constrain them together in order that torus_0 would be pinned to sphere_0, and so on.

I'm using an Apply Relationship node with an RBD Spring Constraint connected as relationship. The applyrel node is set to Number Of Relationships Per Object Pair, which seems to create the constraint between all possible combinations of objects by default.

I derived from the examples that I should write an expression for the Activation parameter of the applyrel node, so it would only create a constraint where the indices extracted from the object names match.

However in the applyrel node there only predefined variables are $AFFECTORID and $AFFECTEDID which return indices of the objects, and what I'd need is their names based on these indices.

Any ideas?

imre

Link to comment
Share on other sites

You should be able to use something like dopobjectlist() and pass in the id as the spec argument. It should search for the id and if you give the 3rd arg as 1, return the name.

Thanks a lot -- first I didn't quite get what you meant, then I realized that in DOPs the object ids and object names are kind of interchangeable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...