Jump to content
Developer Wiki and Function Reference Links ×

Set a Wall Style for a Custom Tool


Recommended Posts

I posted this in the "General" area of the Forum but didn't get any responses, so I thought maybe it was better suited here ... here is my problem:

I am trying to create a Custom Tool using the Custom Tool/Attribute menu command that will draw a wall in a specific class and layer but also of a specific Wall Style. The command doesn't seem to address Wall Styles, in fact it seems to automatically draw only Unstyled walls. I think the answer would be to manually insert a line in the script setting the Wall Style, but I haven't used Vectorscript in about 15 years. I've tried to figure it out with no luck. Here is the script the tool automatically creates. It seems to me that right after the line "CallTool(-208);" another line setting/calling the Wall Style should/could be inserted, but nothing i've tried works. I created a Custom Modification script to get the Wall Style, it says "EditProperties((WST='Building Wall'));" (without the quotes) so I tried inserting "SetWallStyle((WST='Building Wall'));" but got an error. Any help would be greatly appreciated. Thanks.

Monadnoc

Procedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

PushAttrs;

Result := DeleteAllComponents(nil);

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

Result := SetComponentName(nil, 1, '');

Result := SetComponentClass(nil, 1, 0);

Result := SetComponentFillColors(nil, 1, 257, 257);

Result := SetComponentPenColors(nil, 1, 257, 256, 257, 256);

Result := SetComponentUseFillClassAttr(nil, 1, FALSE);

Result := SetComponentUsePenClassAttr(nil, 1, FALSE, FALSE);

PenSize(2);

PenPat(2);

SetZVals(0", 0");

FillBack(1278);

FillFore(257);

FillPat(1);

Result:= SetDefaultBeginningMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);

Result:= SetDefaultEndMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);

PenPat(2);

PenSize(2);

NameClass('Architecture-First Floor');

Layer('Building and Boundary Layer');

PenBack(256);

PenFore(257);

PenPat(2);

CallTool(-208);

PopAttrs;

END;

Run(CustTool);

Link to comment

Looking at the definition of the function, there are missing parameters in your code:

FUNCTION SetWallStyle( theWall :HANDLE; wallStyle :STRING; selectedOffDistance :REAL; replacingOffDistance :REAL) : BOOLEAN;

It should be something like:

....

CallTool(-208);

result:= SetWallStyle(LNewObj,'Building Wall',0,0);

....

Link to comment

Thanks for your response. I tried pasting in the line

result:= SetWallStyle(LNewObj,'Building Wall',0,0);

right after the CallTool(-208); line like you have it, but it doesn't seem to work. The Walls it draws still come out as unstyled. I am very rusty at VS so maybe I am misunderstanding something. All I did was add that line. Do I need to add anything else?

Thanks.

Monadnoc

Link to comment
  • 10 years later...

Procedure CustTool;
VAR
Name:STRING;
Result:BOOLEAN;
BEGIN
PushAttrs;
Result:= SetWallStyle(LNewObj,'Building Wall',0,0);
PenSize(2);
PenPatN(2);
SetZVals(0", 0");
FillBack(256);
FillFore(1252);
FillPat(1);
Result:= SetDefaultBeginningMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);
Result:= SetDefaultEndMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);
PenSize(2);
NameClass('House-Remaining');
Layer('House Walls');
PenBack(256);
PenFore(257);
PenPatN(2);
TextFont(28);
TextJust(1);
TextSize(12);
TextSpace(2);
TextFace([]);
CallTool(-208);
PopAttrs;
END;
Run(CustTool);

 

I added the line "Result:= SetWallStyle(LNewObj,'Building Wall',0,0);"

 

and deleted the lines

"

Result := DeleteAllComponents(nil);
Result := InsertNewComponentN(nil, 1, 6", 5, 0, 0, 2, 2);
Result := SetComponentName(nil, 1, '2D/3D Wall Existing');
Result := SetComponentClass(nil, 1, 0);
Result := SetComponentFillColors(nil, 1, 257, 256);
Result := SetComponentPenColors(nil, 1, 257, 256, 257, 256);
Result := SetComponentUseFillClassAttr(nil, 1, FALSE);
Result := SetComponentUsePenClassAttr(nil, 1, FALSE, FALSE);

"

the deleted line where created by the custom tool command

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