Examples

Overview

How to use the action callbacks in STD-SHOWFILE-DIALOG

Creates two random files, shows one file in a listbox, providing a special callback. On any click onto the listbox it shows the corresponding line in the status line, on double click it opens the other file in a new dialog.

defined: rand-char, rand-word, rand-line, random-file, show-action-cb, switch, show-status-cb, std-ft-nth-line, std-strlist->string, ...

using: std-showfile-dialog, std-filename-mktemp

Decode encrypted ACIS data ACIS-REGION

Extracts some REGION and other useful encrypted internal ACIS info from a 3DSOLID.

defined: acis-decode, acis-region, acis->point, acis->vertex, acis->edge, acis-point-p, acis-vertex-p, acis-edge-p, acis-nth-pointer

using: std-remove-if, std-remove-if-not, std-string->list

C:LENGTHEN Example

Framework for a LENGTHEN command, without geometry.

using: std-getdist, std-entsel, std-default-type

Write XYZ data (SDF or CDF formatted) to a file

As FAQ [21.8]

defined: cdf-point, sdf-point, C:XYZ, C:ASC, str->point

using: getfiled, std-getpts, std-sslist

How to MODIFY block attributes? DATESTAMP

As FAQ [22.2]

using: std-attchg, std-ssmap, std-today

JOIN multiple lines to polylines

As FAQ [23.2]

using: std-sslist, std-entity-type-p, std-getflag, std-flagsetp

Change WIDTH of multiple polylines POLYWID

As FAQ [23.3]

Two solutions, one with std-sslist and one with std-ssmap

using: std-getdist, std-sslist, std-ssmap

Area and length of multiple objects POLYLEN

As FAQ [23.5]

There are two ways:

1. the obvious, using the AREA command which is quite "noisy" (prints the result), but works with every entity type, even with splines.

2. doing some math, but works only for simple polyline segments, no splines.

defined: C:LEN-OF, C:AREA-OF, C:POLYLEN, POLY-LENGTH

using: std-ssmap, std-seg-length, std-pline-segs

Using the RANDOM functions

Draw a random point cloud until any key is pressed, re-do the same cloud again. Create a random poem and draw a turtle fractal until a key is pressed.

defined: point-cloud,

using: std-random, std-make-random-state, std-randomize, std-random-elt,
ai_undo_push, ai_undo_pop, with (command "U")
(grread T), std-zoompts, std-read-file-strings, std-strjoin, grdraw

Binary File IO Examples

Write a binary file and read it back in, comparing for failures.

defined: testout, testin, int-list, inc-list, *error*, compare

using: apply, almost all binary file binio-fxxx funcs

Module Example

Defining a module. Needing other modules.

using: std-provide, std-require, *MODULE-PATH*