Specific Grouping Use Case
All  1-2  3-14

Previous
Next
 From:  scott (SSHWARTS)
7464.3 In reply to 7464.2 
Michael:
I most certainly would relish a Group command that operates on any set of objects. I was just trying to explore if there was something I was missing in the current version that would make it easier to keep these imported objects together. I explored at one time how much work it as get all the edges joined up etc, and it became about the same amount of work as redrawing them!

I've seen in other software where upon import it automagically groups the objects (or not as an option) but it is indeed just a part of the group mechanism.

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.4 In reply to 7464.3 
Hi Scott, well the problem is the current version just does not have the low level selection infrastructure that you need to enforce keeping things together. That's something that has to be done in the core selection engine, it's not really something that can be done with a script.

When I do have a proper group mechanism my current general plan is to have a checkbox option at grouping time for "Select as one", which can be turned on or off to control whether the group will select as one unit when you click on it or not.

- 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:  scott (SSHWARTS)
7464.5 In reply to 7464.4 
Is there a script already that can be assigned to a key where if you select a named object, you can have it select all other objects of that same name? In that way, you could click on a part, and then make sure that all objects of the same name are then selected before moving.


Thanks
  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.6 In reply to 7464.5 
Actually, I guess it's easy, yes?:

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

}
  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.7 In reply to 7464.6 
Hi Scott, yup that looks like it ought to do what you want!

- 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.8 In reply to 7464.7 
Hi Scott,

Thanks for that script. I just tried it, but I get the following error message:



What´s wrong?

It´s the first script I try to install. Just took the script text, put it into text editor, converted to plain text, and changed the fileformat to .js . Then I put it into the commands folder and assigned a shortcut to it.

Another very useful tutorial regarding groups I found is by Max Smirnov: https://www.youtube.com/watch?v=HGiZgl2Q6g8

Asked him for the script via PM. Or does anybody know where to find it in this forum?

-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:  Frenchy Pilou (PILOU)
7464.9 In reply to 7464.8 
Max Smirnov can send something to him I suppose! :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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.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-2  3-14