AutoCAD Express Tools

Reply
*dolives
Message 1 of 3 (364 Views)

RTEXT and xref ?

364 Views, 2 Replies
08-27-2002 04:08 PM
I want to adding a deisel expression string in a title block, in RTEXT.
What else do I need to get all the xref name to be displayed also?
Thanks in advance.

dolives
*da2boyz
Message 2 of 3 (364 Views)

Re: RTEXT and xref ?

08-27-2002 10:16 PM in reply to: *dolives
Goto Express ---> Help
and search for rtext. There are a bunch of examples.

From the help file:



Using Diesel Expressions

The DIESEL option provides options previously accessible only with custom
programs. Here are some examples of how Rtext objects with DIESEL
expressions can be used in your drawings. You can paste these examples into
the Diesel Expression dialog box.
The following DIESEL expression displays the drawing name:

Drawing file: $(getvar, "dwgname")

The output looks like this: Drawing file: 102-fp12.dwg
To include the directory path along with the file name, use the following
DIESEL expression:

Drawing name: $(getvar, "dwgprefix")$(getvar, "dwgname")

The output looks like this: Drawing file:
C:\Projects\97-102\Arch\102-fp12.dwg
If you place this string in an Rtext object in your standard title block, it
always displays the correct file name of the drawing. This works even if
your title block is an xref and the Rtext DIESEL expression resides in that
xref.

When you plot a drawing, you may want the hard copy to show the date and the
time that the plot was created. The following DIESEL expression allows you
to display this information in your drawing:

$(edtime, 0, MON DD"," YYYY - H:MMam/pm)

The output looks like this: Sep 17, 1997 - 11:12pm

The $(getprop) DIESEL function

RTEXT supports Drawing Propertiesdwgprop@acad.hlp>main through a locally
defined $(getprop) DIESEL function. With (getprop), user and certain system
generated text strings displayed in the Drawing Properties dialog box tabs
can be extracted and displayed as RTEXT.

The syntax for the (getprop) DIESEL function:

$(getprop, )

can be any of the following fields from the PROPERTIES
command:

Title

Subject

Author

Comments

Keywords

LastSavedBy

Revno

% ( is the name of a user-supplied field
from the Custom tab)

For example, if the Drawing Properties for a drawing contains the text
"Excavated Site" in the Subject field on the Drawing Properties Summary tab,
the expression $(getprop, subject) displays "Excavated Site" as Rtext.

Note: The (getprop) function is local to the RTEXT tool (rtext.arx ).
Unlike arguments supplied to DIESEL functions elsewhere within RTEXT or
outside of the RTEXT function (DIESEL menu macros and arguments to the
MODEMACRO system variable), arguments to (getprop) cannot be quoted.
Supplied arguments are not case-sensitive. For example, in a custom field
called "Project Name," you can use the following RTEXT DIESEL expression to
display its value:

$(getprop, %PROJECT NAME)

Note: Errors to the (getprop) function such as improper syntax or bad
argument are displayed as "(GETPROP ERROR)", returned as RTEXT. If a
nonexistent custom field name is used, the (getprop) function displays an
empty string.

For a complete list of DIESEL functions see the Catalog of DIESEL String
Functions.

The $(xrefs) DIESEL function

RTEXT supports listing xrefs attached to the drawing through a locally
defined $(xrefs) DIESEL expression.

The syntax for the $(xrefs) DIESEL function:

$(xrefs [, [, [,]]] )

is a collection of bitflags with the following meanings:

1 = include xref file name (not exclusive with flag 2) (default)
2 = include xref block name (not exclusive with flag 1)
4 = remove file name extension
8 = remove path
16 = show nesting with additional spacing

is a text string inserted before each xref entry. The default value
is "".

is a text string inserted after each xref entry except the last.
The default value is "\r\n" (a new line).

Example:

The RTEXT DIESEL expression $(xrefs,3) displays a list of the drawing's
xrefs on the screen in the following format:

B-ELEC [c:\proj-14\b-elec.dwg]

M-ELEC [c:\proj-14\m-elec.dwg]

R-ELEC [c:\proj-14\r-elec.dwg]

F-ELEC [c:\proj-14\f-elec.dwg]

The RTEXT DIESEL expression $(xrefs,2,Includes: ) displays a list of the
drawing's xrefs on the screen in the following format:

Includes: B-ELEC

Includes: M-ELEC

Includes: R-ELEC

Includes: F-ELEC

The $(images) DIESEL function

RTEXT supports listing images attached to the drawing through a locally
defined $(images) DIESEL expression.

The syntax for the $(images) DIESEL function:

$(images [, [, [,]]] )

is a collection of bitflags with the following meanings:

4 = remove file name extension
8 = remove path

is a text string inserted before each image entry. The default
value is "".

is a text string inserted after each image entry except the last.
The default value is \r\n (a new line).

The $(getrec) DIESEL function

RTEXT supports displaying Xrecord data stored in the drawing through a
locally defined $(getrec) DIESEL expression.

The syntax for the $(getrec) DIESEL function:

$(getrec,,)

Extracts a value from an xrecord by looking in the Named Object Dictionary
for an entry, , then for a data value associated with the group code
. Currently, only group codes in the ranges 1...9 (string), 40...59
(real), 60...79 (integer) and 300...309 (string) are supported.

Example:

When using PROPERTIES, the 'Title' field of the Summary tab contains the
value 'Base-Electrical', the following RTEXT DIESEL expression displays '
Base-Electrical' on the screen:

$(getrec, DWGPROPS,2)
*dolives
Message 3 of 3 (364 Views)

Re:

09-03-2002 10:20 PM in reply to: *dolives
Thanks for you answer !
But I want information.
The folowing field, "Revno", never change can you tel me why ?
And only "props" 40, 41 and 42 are use.
43...59 (real) not use ?
60...79 (integer) not use ?
Thanks
Sorry for my english, I am a french user !
dolives

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community