home products news downloads documentation support gallery online maps resellers search
TNTmips Downloads Menu

HOME

CONTACT US

CURRENT RELEASE
  TNT 2013

DEVELOPMENT VERSION
  TNT 2014

TNTmips Pro
PRIOR RELEASES
  TNT 2012

FREE SOFTWARE
  TNTmips Free
  TNTatlas
  TNTsdk

MORE DOWNLOADS
  HASP Key Driver
  Screen Recorder
  TNT Language Kits
  Sample Geodata
  TNT Scripts

DOCUMENTATION
  TNTmips Tutorials
  Tutorial Datasets
  Technical Guides
  Scripts
  Quick Guides

MORE INFO
  Download FAQs
  FTP
  Download Managers
  Find Reseller

SITE MAP


text.sml

    See other examples and scripts with XML...


# text.sml
# demonstrate creating and reading a text CAD element

clear();
string format$ = "%7d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f \n";

# create a new file or open existing file
cad C;
GetOutputCAD(C);

# write some text

numeric baseX1 = 100, baseY1 = 100, baseX2 = 200, baseY2 = 100, height = 100;
numeric rotation = 0, xScale = 1.0, shear = 0;

# since rotation = 0 we will use both basepoints
string text$ = "CAD text string 1";
CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);

# the elements are always appended to end of block
# so get number of elements - last element will be our text
numeric lastelem = CADNumElements(C, 1);

# now read data for most recently added element
text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);
print("write and read CAD text");
print("element   baseX1   baseY1   baseX2   baseY2   height ", "rotation   xScale    shear");
printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);
print("Text: ", text$);

# now use rotation and one base point
baseX1 = 100;
baseY1 = 500;
baseX2 = 0; # don't care
baseY2 = 0; # don't care
height = 100;
rotation = 45;
xScale = 1.0;
shear = -40;   # angle text backwards

text$ = "CAD text string 2 - rotated and sheared";
CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);
lastelem = CADNumElements(C, 1);

# now read data for most recently added element
text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);

printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear);
print("Text: ", text$);
CloseCAD(C);


Back Home ©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010   USA
Business & Sales: (402)477-9554  Support: (402)477-9562  Fax: (402)477-9559
Business info@microimages.com  Support support@microimages.com  Web webmaster@microimages.com

25 March 2009

page update: 26 May 11