Craig D.S. Posted March 5, 2012 Share Posted March 5, 2012 Greetings... would there be any simple examples of creating Primitives or 2d objects to get started with. I would like to start on some fun stuff first starting with a ring of spheres or cones etc My only scripting experience is with AutoCAD/TurboCAD VBA Much Appreciated Quote Link to comment
Hippocode Posted March 15, 2012 Share Posted March 15, 2012 Hey, I recently made a small plugin object trough the plug-in editor(Tools=>scripts=>vw plugin editor). Its ment to be a heat device drawn as a rectangle and some info in it. I've added it to my post, use it as a plug in object or look at the code of it to give you a heads up.. PROCEDURE Radiator; VAR bc_ht,bc_wid,bc_height,bc_vermogen,i: REAL; bc_fontsize,keuzes,height,numberpos : INTEGER; objname,vermogen,bc_number: STRING; bc_textposition,bc_numberposition: CHAR; oh,rh,wh: HANDLE; result,hidetext,shownumber: BOOLEAN; BEGIN { retrieve custom object information } result:= GetCustomObjectInfo(objname,oh,rh,wh); { if object information was successfully retrieved } IF result THEN BEGIN { retrieve predefined parameter values } bc_ht := PRWIDTH; bc_wid := PRLENGTH; bc_height := PRHEIGHT; bc_vermogen := PVERMOGEN; bc_textposition := PSHOW_VERMOGEN; bc_numberposition := PSHOW_NUMBER; bc_fontsize := PFONTSIZE; bc_number := PNUMBER; vermogen:=concat(bc_vermogen,' W'); { retrieve user-defined parameter values } { draw } i:=0"; PushAttrs; FillPat(0); { draw rectangle with coordinates } Rect(0,bc_ht,bc_wid,0); { draw text } TextFont(GetFontID('Monaco')); TextSize(bc_fontsize); TextJust(2); hidetext :=true; shownumber :=true; CASE bc_textposition OF 'O': height :=bc_ht+25; 'I': height :=bc_ht; 'H': hidetext :=false; OTHERWISE height :=bc_ht+25; END; IF hidetext THEN BEGIN TextOrigin(bc_wid/2,height); BeginText; vermogen EndText; END; CASE bc_numberposition OF 'L': BEGIN numberpos :=3;height:=-5; END; 'R': BEGIN numberpos :=1; height:=bc_wid+5; END; 'H': shownumber :=false; OTHERWISE BEGIN numberpos :=3; height:=-5; END; END; IF shownumber THEN BEGIN TextJust(numberpos); TextOrigin(height,bc_ht); BeginText; bc_number EndText; END; PopAttrs; END; END; Run(Radiator); 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.