Return to Symbol


Get Solid Sectioned to Create a Crosshatch Example

This example shows how to determine the solid that was sectioned to create a crosshatch object.

ENTITY/object, solid
NUMBER/objsub, resp
STRING/name(30)
$$
crsmod = &VWCURS
&VWCURS = &ANY
$$
$$ set selection mask for Drafting Aids (type 25)
  MASK/25
$$
start:
$$ select object
  IDENT/'Select Crosshatch', object, resp
  IF/resp <= 2, JUMP/finish:
$$
$$ deduce object subtype
  objsub = &SUBTYP(object)
$$ ensure the object is a Crosshatch (subtype 6)
  IFTHEN/objsub == 6
$$ find the Solid that was sectioned to create the Crosshatch
  solid = &SXHSOL(object, IFERR, errdo:)
$$ a NULENT means an associated solid could not be found
  IF/solid == &NULENT, JUMP/errdo:
  name = &NAME(solid)
    PRINT/'The name of the sectioned Solid is', name
  ELSE
    MESSG/'A Crosshatch was not selected.'
  ENDIF
  JUMP/start:
$$
errdo:
  MESSG/'The Crosshatch is not associated to a sectioned Solid.'
  JUMP/start:
$$
finish:
  &VWCURS = crsmod
HALT