PDA

View Full Version : Problems on setting variables


Loki
05-06-2008, 04:24 PM
I have a trouble about a simple code...
Here an example wrote only to explain my question:

SelectObj "Piero*"
for each polymsh in Application.Selection
LogMessage polymsh
LogMessage polymsh.Name
LogMessage polymsh.Model
set pModelName = polymsh
set pName = polymsh.Name
next


If i run it, XSI give me these lines:

'INFO : Piero_Weight.Piero
'INFO : Piero
'INFO : Piero_Weight
'INFO : Piero
'ERROR : Object required: '[string: "Piero"]' - [line 7]


Why polymsh.Name is valid for a LogMessage, but invalid for a simple set string?
Where I wrong?

SebasProulx
05-06-2008, 05:04 PM
You use "set" for an object, but the result of "polymsh.Name" is a string, so just remove "set" before "pName".

Loki
05-07-2008, 05:42 AM
Uh! Right... I'm feel so stupid
Thanks a lot for your help Sebas