Jump to content
Developer Wiki and Function Reference Links ×

Wall Parameters in a script? help!


Recommended Posts

I'm having trouble using the custom tool/attribute tool to define wall scripts.

Thus far I have the following 'customized' script generously supplied by someone on the VWuser list, which controls the wall thickness and class:

Procedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

PushAttrs;

Result := DeleteAllComponents(nil);

Result := InsertNewComponent(nil, 1, 6", 0, 0, 0, 2, 2);

SetZVals(4", 8'0");

NameClass('A-Wall-Mason-Block');

CallTool(-208);

PopAttrs;

END;

Run(CustTool);

With regards to the line "Result := InsertNewComponent(nil, 1, 6", 0, 0, 0, 2, 2);"

What do each of these values mean??

Also, how can I specify the wall height and z-values for the wall in the script?

And how about the Wall Style? I've tried a few things but the setting always get overriden by the wall tool preferneces which are set to an "unstyled" wall.

Any help is greatly appreciated!

Andrew

Link to comment

Hi Andrew

It sounds like you're pretty new to vScript, and I don't use walls, but maybe I can help you a bit anyway.

You need to take a look at Vectorscript Function Reference. That's under vectorscript somewhere in help. This is a long list of vScript functions with a few hints on how they work. The numbers after InsertNewEtc are the parameters for that function. If you look up InserNew in the reference you'll find a description of what each of these numbers do. You should also spend some time with the language guide to help you understand how scripts are structured.

You should look up all the functions in this script so you can start to understand what's going on here.

As to your other Q's... You're probably going to need to add a few things to this script. CallTool(-208) gets you the wall tool and at the line after that you basically have your wall. You then need to get a 'Handle' to that object to do further object manipulation. All objects in a drawing have a handle, and you need to get this so you can tell the compiler which object to work on. It's a unique identifier.

My guess is that you'll need something like

h := FSActLayer;

SetWallHeights(h, 12, 23);

SetWallStyle(h,'style name in single quotes',0,0);

You'll also need to tell the compiler what 'h' is so that it knows how to use it. You do this kind of thing below VAR. You'll need h:HANDLE; somewhere between VAR and BEGIN. These are the kinds of things you can learn about in the language guide.

You should be aware that scripting is very literal. By that I mean that you have to have all your punctuation and spelling exactly right, otherwise your script will generate all kinds of errors. And that's all it will do.

At this point in your career as a scripter you're going to have to do a lot of trial and error to get what you want. But with bone-headed determination and plenty of time to play around, you can get results. The things that I suggested for wall height and style may or may not work. I don't have Architect12, so I can't actually test this.

With this in mind, be sure to keep working backups of your script all along the way.

Just trying to help you along.

Charles

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...