Jump to content
Developer Wiki and Function Reference Links ×

setting special classes for doors and windows


Recommended Posts

hi to all,

i'm a newbie to vectorscript but have experience with several other languages. i want to write a script to go through every door and window item in my file and set their Special Classes parts for Jamb, Sill, Trim, etc, to Style-1 or Style-2 or whatever. sick of doing this by hand for big files that get handed off to me.

any help pointing me in the right direction is greatly appreciated, vectorscript is totally new to me.

thanks.

nathan.

Link to comment

First you should get rid of those silly and inefficient class names. You can edit the pop-up lists with the plug-in editor.

After that, you use whatever means you choose & can to traverse the plug-ins: you have to get a handle to them. Finally,

SETRFIELD(objectHandle, pioName, fieldInQuestion, newValue);

should do the trick.

For traversing & handles, consider the FOREACHOBJECT -group of constructs as you seem to want all instances changed

In future, you may not need to change anything, if you set the default values of the PIOs to your liking.

Link to comment

PIO = Plug-In Object, such as the doors and windows you seem to be dealing with. The defaults (& desired value lists) are set with VectorScript Plug-In Editor, in the Paramaters section.

Each document also has its own default settings for each PIO, but those do not include the value list items, only the default choice in the list.

It is a bit time-consuming to do, but then you can have "clear glass", "aluminium", "timber" and so on, instead of Style-1 etc.

Link to comment

As Petri says you can edit the PIO value list items so the choices have meaningful names. We shouldn't have to do this though. The Style-1, Style-2, etc protocol is a nonsense which should never have started, let alone persist for as long as it has. It is user unfriendly, confusing and downright frustrating. I look forward to the day when I no longer have to deal with it.

If it is still around in the next version the people responsible should be taken to the stocks and publicly humiliated!

Link to comment

i'm having trouble getting going with this. pascal's grammatical structure is not making sense to me yet. i've only got experience with actionscript in flash and mel in maya. if someone could show me how to use FOREACHOBJECT to list every window and door in my scene and then SETRFIELD to set all of their style classes to Style-1 except the int/ext trim which will be Style-2.

any help appreciated.

the stocks huh? maybe the programmers are just having a hard time changing their own class from Style-1 to Style-2. or maybe their just opaque.

Link to comment

Hi Vector

Windy in Bellingham today? Howling over here in Victoria.

I think you should take a look at 'Info Editor' here:

http://softwarecustomizationservices.com/

You might want to take a look at a thread just above this forum in WishList titled something like 'Editing PIO's en Masse" that discusses this tool.

It looks it will do want you want (and a lot more), but I couldn't tell from the documentation if it does class styles for sure.I'm almost certain it does. I don't use doors and windows, but I'll probably get this anyway.

There's not much chance you or I could write a more powerfull and flexible tool.

However, if you want to try I can help send you in the right direction. Check back in a day or two. And if you do get InfoEditor, let us know what you think.

I assume you've read the v-script language guide in help?

Later

Charles

Link to comment

The basic recipe your home-brew might look roughly (very) like this:

PROCEDURE ClassStyle;

PROCEDURE SetTheDamnThings(h :HANDLE);

BEGIN

SETRFIELD(h, pioName, fieldToChange, newValue);

SETRFIELD(h, 'Door'?, anotherField, newValue);

SETRFIELD(h, 'Window'?, yetanother, newValue);

etc;

etc;

and so on;

END;

BEGIN

ForEachObject(SetTheDamnThings, T = (see appendix in function ref for object types);

END;

Run(ClassStyle);

TIP: A good way to get criteria constructs that might be more complex than above is to use 'Custom Selection' menu command to make a script, and copy and paste that off the script palette (option/click for access to text).

Link to comment
  • 2 weeks later...

i've got it working, so thanks to everyone, but as usual i've run into more problems. the whole reason i'm doing this is to export to cinema4D, and everything has to have unique textures. heres the script hacked together from ccrofts ref:

PROCEDURE ClassStyle;

PROCEDURE changeWindows(h :HANDLE);

BEGIN

SETRFIELD(h, 'Window', 'ExtSashClass', 'Style-1');

SETRFIELD(h, 'Window', 'IntSashClass', 'Style-1');

SETRFIELD(h, 'Window', 'ExtJTClass', 'Style-2');

SETRFIELD(h, 'Window', 'IntJTClass', 'Style-2');

SETRFIELD(h, 'Window', 'LintelClass', 'Style-1');

SETRFIELD(h, 'Window', 'IntShutterClass', 'Style-1');

SETRFIELD(h, 'Window', 'ExtShutterClass', 'Style-1');

SETRFIELD(h, 'Window', 'SillClass', 'Style-1');

SETRFIELD(h, 'Window', 'StoolClass', 'Style-1');

SETRFIELD(h, 'Window', 'GlazingClass', 'Style-1');

SETRFIELD(h, 'Window', 'Glazing', 'Smoked');

SETRFIELD(h, 'Window', 'ExtSillTrimClass', 'Style-1');

SETRFIELD(h, 'Window', 'IntSillTrimClass', 'Style-1');

END;

BEGIN

ForEachObject(changeWindows, (INSYMBOL & INVIEWPORT & (PON='Window')));

END;

Run(ClassStyle);

the problem i'm having is that after running the script the windows don't update. they get the part classes assigned properly, so i can set Style-1, Style-2, etc, in the classes window to have a certain texture. but the don't update on the window itself until i change something on it in the ObjInfo pallete (switching texture from Class Texture to None, or changing in option, or toggling plan detail on and off. i tried toggling plan detail on and off by script, but it doesn't help. i have to change something on each window in the info pallete. its just really annoying. if anyones got any ideas how to get these windows to update and display the textures that ARE assigned to them by part classes, please shout out.

thanks.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...