Jump to content
Developer Wiki and Function Reference Links ×

drawing a cupboard


Recommended Posts

With my limited knowledge of Vectorscript, I tried to write a simple script for the sign of a low and high cupboard in floor plans. The intention is for the low cupboard to have a white filling and the high cupboard to have a dark gray filling. I want to get this by choosing the high or low cupboard in my info pallet. I manage to draw the low cupboard with white filling, but if I choose high cupboard, I only get a line and my cupboard disappears. Could someone help me make this script workable. If it is possible to give a height via the script, this would be a very nice extension for me. Thanks in advance for the help.

[P] kasten.vso

 

Procedure kast; 

VAR 
a,v,l:REAL; 
teller:REAL;
verdeling:boolean; 
tk:string;


BEGIN 

a:=pdiepte; 
v:=pv;
l:=Plinelength;
verdeling:=pverdeling;
tk:=ptk;

IF tk ='lage kast'THEN BEGIN
rect(0,0,l,a);
FillBack(0);
FillFore(257);
FillPat(1);
PenSize(4);
PenBack(256);
PenFore(257);
PenPatN(2);
DSelectAll;
IF verdeling THEN BEGIN
PenSize(1);PenBack(256);PenFore(257);PenPatN(-499);
teller:=1; 
line(0,a);
MoveObjs(v,0,FALSE,FALSE);

REPEAT
Duplicate(v,0); 
teller:=teller+1; 
UNTIL ((v*teller)>l-v); 
end

ELSE IF tk ='hoge kast'THEN BEGIN
rect(0,0,l,a);
FillBack(1238);
FillFore(257);
FillPat(1);
PenSize(4);
PenBack(256);
PenFore(257);
PenPatN(2);

DSelectAll;
IF verdeling THEN BEGIN
PenSize(1);PenBack(256);PenFore(257);PenPatN(-499);
teller:=1; 
line(0,a);
MoveObjs(v,0,FALSE,FALSE);

REPEAT


Duplicate(v,0); 
teller:=teller+1; 
UNTIL ((v*teller)>l-v); 
end

 


END; 
end;
end;

Run (kast); 

Edited by tismacfan2
Link to comment

You seem to be displaying fill pattern 1 which is the foreground but changing the background colour.

Try setting it to fill pattern 2 or changing the fill foreground colour.

Also using PushAttrs and PopAttrs for storing and resetting the current attributes is a good habit.

 

If you extrude your rectangle it will have height and be 3d, after which it can be moved with the move3d procedure.

You could also switch the plane mode to working plane before drawing the rectangle, after which move3d should work on the rectangle. just remember to return it to its previous setting. If you simply want to know the cabinet elevation in plan view, simply create another parameter for displaying in the object info palette.

Link to comment

See if this works for you.

 

Procedure kast; 

VAR 
a,v,l:REAL; 
teller:REAL;
verdeling:boolean; 
tk:string;


BEGIN 

a:=pdiepte; 
v:=pv;
l:=Plinelength;
verdeling:=pverdeling;
tk:=ptk;

IF tk ='lage kast'THEN BEGIN
rect(0,0,l,a);
FillBack(0);
FillFore(257);
FillPat(2); {change made here}
PenSize(4);
PenBack(256);
PenFore(257);
PenPatN(2);
DSelectAll;
IF verdeling THEN BEGIN
PenSize(1);PenBack(256);PenFore(257);PenPatN(-499);
teller:=1; 
line(0,a);
MoveObjs(v,0,FALSE,FALSE);

REPEAT
Duplicate(v,0); 
teller:=teller+1; 
UNTIL ((v*teller)>l-v); 
end

ELSE IF tk ='hoge kast'THEN BEGIN
rect(0,0,l,a);
FillBack(1238); {I did not check to see if this value is in range}
FillFore(257);
FillPat(2); {change made here}
PenSize(4);
PenBack(256);
PenFore(257);
PenPatN(2);

DSelectAll;

IF verdeling THEN BEGIN
PenSize(1);PenBack(256);PenFore(257);PenPatN(-499);
teller:=1; 
line(0,a);
MoveObjs(v,0,FALSE,FALSE);

REPEAT


Duplicate(v,0); 
teller:=teller+1; 
UNTIL ((v*teller)>l-v); 
end

 


END; 
end;
end;

Run (kast); 

Link to comment
  • 1 month later...

This is an excellent case for the use of Data Visualization in a Viewport.

 

Create a Record eg. Cupborard Height

Assign Data - High or Low to the various cupboards

And then In the Viewport set how you want them  to display based upon the assigned Data value.

 

 

Cupboard Data.png

 

 

Cupboard Data Visualization.png

Edited by bcd
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...