svg.sml

  Download

More scripts: Import & Export

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
Class FILEPATH path  = _context.ScriptDir+"/output.svg";
Class SVG mysvg;
Class GRE_VIEW view;
Class GRE_LAYOUT layout;
Class XmForm form;
form = CreateFormDialog("status");	# dialog must be created but not required to be opened
layout = LayoutCreate("Mount Saint Helens",1); 
LayoutRead(layout,"c:\mtsthelens\mtsthelens.rvc","map8x11");
#########################################################
# if not basing on a view use the layouts settings and those in ini file.
#########################################################
mysvg.UseFirstView(1);
#####################################################
# the following is only needed if UseFirstView == 1      
#####################################################
view  = LayoutCreateView(layout,form,"",300,300);
#### not required unless you actually want to see the layout that is openend ##### 
# 	 layout.DlgObjMgrCreate(form);
#     DialogOpen(form);
##################################################################
############################################################
#  once created any view  setting techniques may be used  .
############################################################
## this uses the layout coordinates and zoom level #########
ViewZoomIn(view,5,1); 
Class POINT2D center;
center.x = 5; 
center.y = 6;
view.Center = center;
##############################################################
#  set various optional parameters                           #
##############################################################
#mysvg.LinkToScripts(1);
#mysvg.ShowDatatips(1,0); #must also be set in layout
#mysvg.ShowCoordinates(1);
mysvg.EmbedImages(1);
mysvg.UseOnlyPNGs(0);	#indicates jpegs preferred.
#mysvg.IncludeLayerControlPanel(1);
mysvg.UseAdobeMenu(1); #adobe svg viewer specific right click menu.
#mysvg.IncludeMeasurementTools(1);
#mysvg.UseFreehandMeasures(1);
mysvg.SetCompression(9); #nine is the highest. 0 is uncompressed.
################## necessary associations #####################
mysvg.SetLayout(layout); #associates the layout with the svg
mysvg.SetPath(path); #output location
#################  now actually render out the svg #####################
mysvg.Write();