View Full Version : How to know the Name of the object?
indeep 08-19-2009, 03:48 PM How is posible with script to do this:
1) Know the name of the object selected
and other button to:
2) Select and object based on the name
|
|
donelgreeko
08-19-2009, 03:50 PM
Hi,
which language? XPresso, Python, C++??
bye :)
indeep
08-19-2009, 04:17 PM
just the easiest way please :P the most common used languange in all the scripts here :)
donelgreeko
08-19-2009, 04:36 PM
I would recommend Python, but in this case Coffee is the easier choice because its built-in.
1)
var op;
op = doc->FindObject("name");
2)
var op;
var name;
op = GetActiveDocument()->GetActiveObject();
name = op->GetName();
indeep
08-19-2009, 09:13 PM
First: Thank you very much I love you for the fast answer :)
But, I can't make them work, :( i put them in the script manager, press the button and nothing happends, i put the name "Sphere" there but the sphere with that name is not selected, etc...
Any idea what im doing wrong?
Per-Anders
08-19-2009, 09:45 PM
Why not just use the inbuilt search tools? There are two, first the filter search in the OM (the little icon like a magnifying glas), and second the main "Search" that you can find in the Command maanger (jsut type search in the name filter and bring up the modeling search), just enter the name and hit enter to select.
indeep
08-20-2009, 04:18 AM
Because I want to make a script that needs to begin selecting a specific object based on a name :P
spedler
08-20-2009, 03:55 PM
But, I can't make them work, :( i put them in the script manager, press the button and nothing happends, i put the name "Sphere" there but the sphere with that name is not selected, etc...
Any idea what im doing wrong?
You're not doing anything wrong. The code won't select the object named 'Sphere' in the object manager, it gives you a pointer to the object so you can do something with it. Until you actually do something, nothing will be apparent in the OM.
indeep
08-20-2009, 10:24 PM
You're not doing anything wrong. The code won't select the object named 'Sphere' in the object manager, it gives you a pointer to the object so you can do something with it. Until you actually do something, nothing will be apparent in the OM.
Oh thanks :) But then, whats the script to actually SELECT the object named "Sphere" on the scene when I execute the script?
Per-Anders
08-20-2009, 10:35 PM
just set it's bit
object->SetBit(BIT_ACTIVE);
CGTalk Moderation
08-20-2009, 10:35 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.