Specific Grouping Use Case
All  1-9  10-14

Previous
Next
 From:  Michael Gibson
7464.10 In reply to 7464.8 
Hi Philip,

re:
> What´s wrong?

Can you please post your _sameName.js file here as a file attachment so I can take a look at it?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Philip (DUESENTRIEB)
7464.11 In reply to 7464.10 
Hi Michael,

there you are. Attached the script.

-Philip
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  scott (SSHWARTS)
7464.12 In reply to 7464.11 
Philip:
I think you're missing the ending brace.

var objects = moi.geometryDatabase.getSelectedObjects();
if (objects.length > 0) {
var name = objects.item(0).name;
moi.geometryDatabase.selectNamed(name);
}

Scott
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7464.13 In reply to 7464.11 
Hi Philip - your script is invalid JavaScript code because it's missing the closing bracket for the if statement.

You've got an open bracket here shown in bold red:

var objects = moi.geometryDatabase.getSelectedObjects();
if (objects.length > 0) {
var name = objects.item(0).name;
moi.geometryDatabase.selectNamed(name);


So to go along with that open bracket you need a close bracket to complete the if statement, like in the attached file.

Once you add the closing bracket your script should then work as you wanted it to.

EDIT: scott beat me to it! :)

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Philip (DUESENTRIEB)
7464.14 In reply to 7464.13 
Thanks Scott and Michael!

Stupid small mistake. Works now.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-9  10-14