tismacfan2 Posted June 10, 2019 Share Posted June 10, 2019 (edited) 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 June 10, 2019 by tismacfan2 Quote Link to comment
LarryO Posted June 14, 2019 Share Posted June 14, 2019 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. Quote Link to comment
tismacfan2 Posted June 14, 2019 Author Share Posted June 14, 2019 Could you not help me by adjusting the script according to your comments please. What I don't really understand much about it. Thanks in advance Quote Link to comment
LarryO Posted June 18, 2019 Share Posted June 18, 2019 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); Quote Link to comment
tismacfan2 Posted June 18, 2019 Author Share Posted June 18, 2019 Thanks in advance for the effort, but even now I get the same with low cabinet I get it correct, but with high cabinet I only get to see a line but when I deselect I see nothing anymore. When I change back to a low cupboard, I see what I want in the right color. Quote Link to comment
Peter Vandewalle Posted July 26, 2019 Share Posted July 26, 2019 Have you tried the “kast” object from the Benelux version? Quote Link to comment
bcd Posted July 27, 2019 Share Posted July 27, 2019 (edited) 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. Edited July 27, 2019 by bcd Quote Link to comment
Recommended Posts
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.