Jump to content
Sign in to follow this  
Sumrak

Selecting objects by type

Recommended Posts

Hi, i have simply question, it is possible to select all objects by type or simply delete type of object without deleting all objects that type?

I think, i know answer :D but, i want this thing clear..

Share this post


Link to post
Share on other sites

A: You can delete one type of objs with replace Object Function.

B: You also can export all your objs to a export script and remove the stuff you like and import again.

C: greets

Edited by Atsche

Share this post


Link to post
Share on other sites
A: You can delete one type of objs with replace Object Function.

B: You also can export all your objs to a export script and remove the stuff you like and import again.

C: greets

:yay: thanks, i forget on export scripts, i used them only in export from ofp :) I never used export scripts for removing objects :)

But, would like to see in future versions of Visitor some better selections options.. this solution export, find and delete objects and import again is not the best :D

Share this post


Link to post
Share on other sites

You can also use the Visitor script 'SelectObjects.vis' to select the object type on your map and then delete them by pressing the delete key on your keyboard.

Planck

Share this post


Link to post
Share on other sites
You can also use the Visitor script 'SelectObjects.vis' to select the object type on your map and then delete them by pressing the delete key on your keyboard.

Planck

That would be easier solution, but where i can find that script, in my Visitor scripts folder are only

Avenue.vis
ClearRoads.vis
EditVerticesHeight.vis
ExportObjects.vis
FindPosition.vis
ImportObjects.vis
ObjectsCounter.vis
SetAbsoluteHeight.vis
ShowAbsoluteHeight.vis
SmoothRoads.vis

:confused:

It is a script created by community, if is, where i can find download link? i search for select objects script, but no results..

Thanks

Share this post


Link to post
Share on other sites

No, I think it is a BI original, however I can't recall where I first got it from.

I'm sure they won't mind me sharing it.

Copy the following code to a text document and save it as 'SelectObjects.vis', make sure it is not saved as 'SelectObjects.vis.txt'.

Place it in your Visitor scripts folder and you should be good to go.

Comment" 
       NAME: SelectObjects
       DESCRIPTION: Selects all objects with the given template.
       USE: Run the script and set the parameters in the input dialog.

       Released: v.1.0.0 - 13.07.2006
       Author: Enrico Turri
       Revisions: 
      ";


echo "-----------------";
echo "SelectObjects.vis";
echo "-----------------";


// ----------------------------------
// starting settings
// ----------------------------------
_doc = getActiveDoc;    // gets the active document


// ----------------------------------
// templates settings
// ----------------------------------
_tmpls = (_doc getObjectTemplates "natural") + (_doc getObjectTemplates "artificial");
_tmpls sortBy {getName(_x) strCmp getName(_y)};
_templNames = [];

{
   _templNames = _templNames + [getName _x];
} forEach _tmpls;


// ----------------------------------
// dialogs definitions and formatting
// ----------------------------------
_dlgInput =    [130, 160, "Select Objects 1.0",
       ["label", 50, 13, "Object template:", 0], ["break"],
       ["listbox", 115, 120, "_objTemplate", _templNames], ["break"],    
       ["ok-button", 50, 13], ["cancel-button", 50, 13]];


// ----------------------------------
// default values for variables
// ----------------------------------
_objTemplate = 0;

// shows the input dialog
_res = dialogBox _dlgInput;

if (_res == 1) then 
{
   // looks for the objects
   _objTemp = _templNames select _objTemplate;
   _objs = _doc getObjectsWithTemplate _objTemp;


   // deletes current selection
   deselectObjects _doc;

   // selects the objects
   _objs selectInDoc _doc;

   // prompts final message
   _nObjs = count _objs;
   _strnObjs = str _nObjs;
   _message = "Selected " + _strnObjs + " objects of type:";
   echo _message ;
   _message = _objTemp;
   echo _message ;
};

Planck

Share this post


Link to post
Share on other sites

Thank you very much Planck, i tested it right now .. this is exactly that, what i need! :yay: :)

Share this post


Link to post
Share on other sites

Hey Planck, while you're on the subject of scripts... :D... how would i go about exporting the size of an object from visitor.

I'm playing with the export/import scripts and they dont maintain the object size. Is there any way of capturing this data?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×