Sei sulla pagina 1di 105

AutoCAD

D P&ID
D Custo
omization:
Evverything from Tagss and Annotat
A tions to
o Symb
bols

In tthis paper, we will discuss all the key conceepts of tags, annotations and symbols, with h special emphasis on custommization to
meeet the needs of o end users. Leearn how to cuustomize AutoC CAD P&ID to crreate and use ccustom symbo ols, and define and utilize
cusstom tag formaats that inheritt properties froom different soources. Learn aabout propertyy acquisition to
o propagate property
valuues from one component
c to another and define
d new rulees for acquisitioon. Learn abou
ut the Join Typ
pe functionalityy and how
to sset it for different symbols, in
ncluding inline Equipment be ehavior to achiieve desired wworkflow.
Co
ontents
I. In
ntroduction ............................................................................................................ .......................................................... 4
Project: Default vs. Templaate................................................................................ .......................................................... 4
II. P
A
A. What is a Default
D Projecct? ................................................................................ .......................................................... 4
B
B. What is a Template
T Projject? ............................................................................. .......................................................... 4
otations ............................................................................................ ........................................................ 11
III. Tags vs. Anno
A
A. What is a Tag AD P&ID? ...................................................................... ........................................................ 12
T in AutoCA
B
B. What is an Annotation in AutoCAD P&ID? ....................................................... ........................................................ 12
C
C. What do we utoCAD P&ID? ........................................ ........................................................ 12
w mean by “ttagging” in Au
IV. Tag Formats ......................................................................................................... ........................................................ 12
A
A. Defining a Tag Format for a family off P&ID Class Definitions
D ......................... ........................................................ 13
B
B. Properties ......................................................................................................... ........................................................ 14
1. P&ID Claass Definitions -Properties ................................................................ ........................................................ 14
2. Drawing Properties ....................................................................................... ........................................................ 17
3. Project Properties
P ......................................................................................... ........................................................ 19
C. Expressions ....................................................................................................... ........................................................ 20
C
1. Expression Syntax ......................................................................................... ........................................................ 20
2. Using Exxpressions.......................................................................................... ........................................................ 28
D eration............................................................................................... ........................................................ 29
D. Auto-Gene
1. Simple Auto-generati
A on ................................................................................ ........................................................ 29
2. Propertyy based Auto--generation .................................................................. ........................................................ 30
EE. Delimiters .....................
. ..................................................................................... ........................................................ 38
FF. Assigning the Tag to an Asset............................................................................ ........................................................ 39
G. Tagging Prompt Behavio
G ors and the Graphical
G Style
e ........................................ ........................................................ 50
H
H. How Tags are
a Stored......................................................................................... ........................................................ 51
II. Notes on Uniqueness ......................................................................................... ........................................................ 53
JJ. Tag Behavio
or during Clon
ning .............................................................................. ........................................................ 54
K
K. Pitfalls and
d Workaround
ds.................................................................................. ........................................................ 54

AuttoCAD P&ID Cu
ustomization Page 2
L. Special Behavior for Line Segment Tag Uniqueness ............................................................................................. 57
V. Annotation Styles...................................................................................................................................................... 57
A. Simple Annotations .............................................................................................................................................. 57
B. Compound Annotations ........................................................................................................................................ 58
C. Creating a New Annotation Style .......................................................................................................................... 61
D. Assigning Format Strings to Attribute Definitions ................................................................................................ 64
1. Using Expressions in Annotation Format Strings .............................................................................................. 72
2. Using Annotations to Edit Underlying Data ...................................................................................................... 75
3. Special Behaviors --Reducer Annotation Styles ................................................................................................ 76
E. Principles of Dynamic Sizing .................................................................................................................................. 77
1. A brief overview of Dynamic Block Principles ................................................................................................... 77
2. Linear Parameters in Annotation Block Definitions .......................................................................................... 78
3. TotalX and TotalY .............................................................................................................................................. 83
VI. Custom Symbols ...................................................................................................................................................... 84
A. Creating Custom Symbols ..................................................................................................................................... 84
1. Block Definition Management .......................................................................................................................... 84
2. Creating a new Graphical Style with a new Symbol.......................................................................................... 85
3. Graphical Style Properties................................................................................................................................. 90
4. Manually switching between Graphical Styles ................................................................................................. 91
5. Associating Graphical Styles with a Property.................................................................................................... 91
6. Using Multiple Graphical Style for an Asset that Spans Drawings .................................................................... 94
7. A note about Attachment Points ...................................................................................................................... 95
B. Dynamic Assets ..................................................................................................................................................... 96
1. Special Behaviors of Off Page Connectors ........................................................................................................ 97
2. Special Behaviors of Instruments...................................................................................................................... 99
VII. Property Propagation/Acquisition .......................................................................................................................... 99
VIII. Appendix .............................................................................................................................................................. 102
A. Format string syntax ........................................................................................................................................... 102
B. APIs ..................................................................................................................................................................... 104

AutoCAD P&ID Customization Page 3


I. Introduction
AutoCAD® P&ID is a design software use to create, modify, and manage piping and instrumentation diagrams. Built
on the latest AutoCAD® platform, AutoCAD P&ID is easy to use and familiar to designers and process plant
engineers. Made specifically for P&ID designers and drafters, AutoCAD P&ID enables faster and more efficient
creation, manipulation, and revisions to P&ID drawings.

This course will cover key concepts in P&ID diagrams --tags, annotations, and symbols --with special emphasis on
customization to meet the needs of end users and their organizations. Topics covered include how to create and
use custom symbols; how to define and utilize custom tag formats that utilize properties from different sources and
use alpha-numeric expressions in formatting. There are examples of how annotations can be formatted and placed
inside custom blocks which are dynamically resized when the size of the text changes. At the end of the course, the
reader should feel confident about customizing P&ID for their own usage.

These things will be covered in this document:


• Tagging vs. Annotating: Key Concepts
• Creating custom Tag Formats: Properties and Expressions
• Creating custom Annotation Styles: Block Definitions and Evaluatable Strings
• Principles of Dynamic Sizing
• Creating custom symbols for Assets

II. Project: Default vs. Template


A. What is a Default Project?
• A preset project is used when a new project has not been specified by the user
• Default settings are set to what the majority of people would choose. There is often no reason to change
them.

B. What is a Template Project?


• A customized project value used when a setting has been specified by the Administrator (user).
• A copy of the default, new, existing, Sample or finished Project
• A Template Project contains all defined settings, folders and required for a client(s).
For many companies, the default standard Project may not be sufficient. It is a good base for starting a project, but
there are always specific company's palettes, symbols, environments and settings that require customization. A
Project contains everything you need to create process and instrument diagrams. Items such as symbols,
annotations, and templates as well as the location to store your settings and drawings are part of your project.

AutoCAD P&ID Customization Page 4


Seee default Auto
oCAD 2015 P&
&ID folder be
elow.

Exampless of the default Project


P (left) and
d the example Teemplate Project ( right)

AuttoCAD P&ID Cu
ustomization Page 5
Bellow is a Clientt specific Tem
mplate folder structure

hen creating a new projectt using the template to cre


Wh eate it, the foollowing proceedure will be crucial.

AuttoCAD P&ID Cu
ustomization Page 6
Staart the Project creator Wizard, fill in the
e information and check “ccopy settings from existingg project” boxx, then
clicck on the button and find the tem mplate projectt to use.

Seee example be
elow:

Lefft Click “Next””

AuttoCAD P&ID Cu
ustomization Page 7
Eveen though you chose a deffine template
e, you still havve the option to change so
ome settings d
during Projecct creation
succh as file path
hs.

Lefft Click “Next””

Maake sure to sp
pecify the Dire
ectory where
e your P&ID drawings will bbe stored. Lefft click “Next”” and specify the Plant
3D models DWG G directory.

Lefft Click “Next””, and choose


e the SQLite lo
ocal database
e.

AuttoCAD P&ID Cu
ustomization Page 8
Now you are at the end of th eation. You caan now check mark on the “Edit additio
he Project cre onal project seettings
after creating prroject” (recom
mmended) orr click “Finish””.

AuttoCAD P&ID Cu
ustomization Page 9
hen finished, open the Pro
Wh oject Setup an
nd look at the
e similarities. Remember to
o click on thee “User defineed reports

directory” button to propriate location.


t define app

AuttoCAD P&ID Cu
ustomization Page 10
Whhen finished, the new Project created using
u the clien
nt define tem
mplate file creaation should look like the example
bellow:

So the question remains…..


• Why is a Template better than the original?
e time it would take to specify all the paage size/layouut properties,, Toolbars, Blocks, Layers, Borders,
Thiink about the
app
ply fonts, enssure all is lined up and mattching to your company's sstandards.

Pro
oject Templattes can help ensure
e a conssistent look an
nd feel.

Deffault projectss are a great start,


s want to know how to creatte their
but mosst developerss and adminisstrators will w
ow
wn templates. AutoCAD 2010 P&ID makes it extreme ely easy to creeate your own templates. In addition, o
once they
aree created, youu have the abbility to modiffy them.

Master template is the begginning of a new, updated,, and better CClient specificc Master project Templatee.
AM

IIII. Tags vs.


v Annotation
ns
Thee word “Tag” and the word “Annotation” have a varriety of usagees in ordinary English, in pllant engineerring and
dessign domain, in various Au
utoCAD featurres, and in the AutoCAD P& ng discussion is specific
&ID product. The followin
to tthe Tagging and
a Annotatio on features ass built for and
d shipped witth the AutoCA AD P&ID prodduct, and is m
meant to
preevent confusion in the rem
mainder of this course. In particular,
p pri or experiencee has shown tthat too man
ny
oveerloaded meaanings for the
e word “tag” leads
l to confusion.

AuttoCAD P&ID Cu
ustomization Page 11
A. What is a Tag in AutoCAD P&ID?
• A Tag is a unique identifier for an asset or line segment
• A Tag is DATA
• A Tag lives in the database (tracked as a property )
• An asset or line segment can have only one Tag
• A Tag is built up of sub parts as defined by the Tag Format

B. What is an Annotation in AutoCAD P&ID?


• An Annotation is text (and optional geometry) in the drawing which presents information about the asset
or line segment.
• An Annotation is graphical.
• An Annotation lives in the drawing, but is linked to the database.
• An Annotation need not be unique
• An asset or line segment may have multiple Annotations
• The text shown by an Annotation is determined by the Format String as defined in the Annotation Style’s
block definition.
• The text shown by the Annotation may include the asset or line segment’s Tag property, but it is not “the”
Tag. It is still an annotation.

C. What do we mean by “tagging” in AutoCAD P&ID?


• “Tagging” means assigning the values for the unique identifier of a given asset or line segment into the Data
Cache
• “Tagging” means creating and storing data.
• “Tagging” is done via the Assign Tag dialog.
• Placing an annotation in the drawing that shows the tag property is NOT “Tagging”, it is “Annotating”.

IV. Tag Formats


Tag Formats are defined at a given level in the P&ID Class Definitions hierarchy, and once defined, are available to
be used by all P&ID classes below that node in the Class Definitions tree. The subparts consist of Properties and/or
Expressions, and may be Autogenerated. The subparts are concatenated together into a single value, and this
completed tag value is validated for uniqueness and stored as a tag property in the Data Cache. We’ll examine each
of these concepts, and discuss a few pitfalls that should be avoided.

AutoCAD P&ID Customization Page 12


A.. Definingg a Tag Fo
ormat forr a familyy of P&ID Class Deefinitions
Tagg Formats are
e accessed fro
om the Projecct Settings diaalog, under thhe P&ID Classs Definitions p
portion of thee tree.

Preessing the “Ne


ew…” button raises the Taag Format Settup dialog.

Sub
bparts can be
e added and removed
r using the spin control next to “Number of SSubparts.” A Tag Format cconsists of
maaximum 25 suubparts.
• Each subpart consistts of a Field an
nd an optionaal Delimiter.
• The Fielld is built up from
f Propertiies and/or an
n Expression.
Note that this Tag Format is being defined d for the classs “HandValvees”, because tthe Hand Valvves node wass selected
in tthe P&ID Classs Definitions tree when we
w pressed “New…”

AuttoCAD P&ID Cu
ustomization Page 13
Thiis Tag Formatt will be availaable to all chiild P&ID classses defined att a more deepply nested levvel in the P&ID Class
Deffinitions hieraarchy; in othe
er words, thiss Tag Format willw be availa ble for all Hand Valves.

B. Propertiies
A TTag Format may
m specify properties of th he object to be
b tagged, prooperties of thhe Drawing, oor properties oof the
Prooject. The first three butto
ons next to eaach sub part provide
p a meaans to select a property off each type fo
or the
subbpart, and are e mutually exxclusive. We will
w examine each
e in turn.

Draawing and Project propertties are read from


f the Drawwing and Projject respectivvely, and will b
become part of the
oveerall tag prop
perty, but assiignments made to these properties via the tagging ooperation willl NOT be storred back to
thee Drawing and d/or Project. These properrties are used
d for initializattion only.

1. P&ID Class Definitions


D -Properties
-
Preessing the lefttmost button raises the Se operty dialog .
elect Class Pro

In m
most situations it is necesssary to speciffy a property that actually exists on thee class for whiich the Tag Fo
ormat is
beiing designed. Therefore, th his example navigates
n to the
t HandValvves node in th he Class tree, and selects oone of the
pro
operties, Valvve Code, definned for Hand Valves.

AuttoCAD P&ID Cu
ustomization Page 14
Thee “Use Targett Object’s Pro
operty” checkkbox is also se
elected. Presssing OK yieldss the following result for th
he subpart
in tthe Tag Format Setup.

As can be seen, the Propertyy has been spe ecified as TarrgetObject.VaalveCode. Also
o, notice thatt the graphicss for the
firsst button now
w appear raise
ed. This indicaates that a claass property is in use.

If the “Use Target Object’s Prroperty” checckbox were deselected, thhe result wou ld have lookeed like this:

Notice that the Property is now defined using


u the actual class namee: HandValves.ValveCode.

TarrgetObject inddicates to the


e program thaat the requessted propertyy is expected tto be definedd for the P&IDD class for
whhich this Tag Format
F is bein
ng defined. It is a shortcut in the nomennclature, and if you are careful in selecting the
pro
operty, is generally approp priate to use.

Anyy property avvailable at a given


g level in the
t hierarchyy is always avaailable at the child level. TThat is, since
“VaalveCode” is a property off HandValves, you can be certain
c that itt is a propertyy of Gate Valvve, Ball Valve,, etc.

eption to the requirement to specify a property


Theere is an exce p defi ned on the P&
&ID class bein
ng targeted.

AuttoCAD P&ID Cu
ustomization Page 15
In ssome special situations, yo
ou may want to include a property
p from
m a P&ID classs directly relaated to the iteem being
taggged, as part of
o the tag value. For exam
mple, the Tag Format
F for Pi peLines specifies a properrty from the
Pip
peLineGroup as a two of the subparts.

To utilize a classs property fro her than that for which thee Tag Format is defined, th
om a class oth he following m
must be
ue:
tru
• The pro b from a class that shares a direct relattionship to th
operty must be he target classs.
• The actu
ual class must be specified
d --the TargettObject nomeenclature can not be used.

AuttoCAD P&ID Cu
ustomization Page 16
2. Drawing Pro
operties
Preessing the seccond button beside
b the subpart raises the
t Select Draawing Proper ty dialog.

Addrawing prope erty may be specified


s as one subpart off a Tag Formaat. Selecting tthe propertiees above yield
ds the
following in the subpart.

Thee second buttton now show ws the raised graphics, ind


dicating that a Drawing pro
operty is seleccted, and thee Drawing
operty is speccified in the Field by Category and Property.
pro

AuttoCAD P&ID Cu
ustomization Page 17
Useers may add custom
c Draw
wing categorie
es and properrties in the Pr oject Setup d
dialog.

Anyy custom Draawing propertties added he


ere will be avaailable to seleect from the SSelect Drawin
ng Property dialog.

AuttoCAD P&ID Cu
ustomization Page 18
3. Project Prop
perties
Preessing the third button nexxt to the subp
part raises the
e Select Projeect Property d
dialog.

Anyy project property may be


e selected as one
o subpart of
o the Tag Forrmat. Selectin
ng the properrties above yiields the
following subpaart:

Thee third button


n now shows the raised grraphics, indicaating that a PProject properrty is selected
d, and the Pro
oject
operty is speccified in the Field by Category and Property.
pro

AuttoCAD P&ID Cu
ustomization Page 19
Useers may add custom
c Project categories and propertiies in the Projject Setup diaalog.

Anyy custom Pro


oject propertie Property dialog.
es added here will be available to selecct from the Seelect Project P

C. Expressiions
1. Expression Syntax
S
Exp
pressions define a simple syntax
s for chaaracter match
hing.
• The chaaracter ‘A’ spe
ecifies an uppper case alphaabetic characcter.
• The chaaracter ‘a’ spe
ecifies any alp
phabetic character.
• The chaaracter ‘N’ spe
ecifies a digit..
• The chaaracter ‘*’ spe
ecifies that an
ny number of the previouss type of character (A, a, or N) may follo
ow.
Whhen expressio
ons are used in conjunction n with a prop
perty, they ennforce the typ
pe of input that is accepted
d when the
pro
operty value is
i being assigned, via the Assign
A Tag diaalog. When ann expression is used indeppendently, noot in
con
njunction with a property, it is called a “pure” expre
ession, and alsso enforces th
he type of inp
put.

AuttoCAD P&ID Cu
ustomization Page 20
Enfforcement is “weak”, mean ning that missmatched inpu ut will result iin user feedback (red text)) in the Assign
n Tag
dia
alog, and an attempt
a to correct the inpu
ut automaticaally via paddinng, truncatio n, or uppercaasing, if possibble.
However misma atched input that
t cannot beb corrected iss still accepteed.

Thee upper two sections


s of th
he Define Expression dialogg illustrate thhis syntax in aaction.

Thee Expression portion of the


e dialog provides a meanss to define thee most comm
mon expressio
ons.

Thee Result portiion of the dialog shows wh hat the expression looks li ke as it is con
nstructed, and
d also allows direct
moodification of the expressioon, or disablin
ng of the exprression.

a) Example 1:
1 Any alph
habetic characters, any
a length
h

In tthe example above,


a the Exxpression spe haracters. It ddoes not speccify uppercasee or a length. Thus the
ecifies Text Ch
exppression builtt in the Resultt box is: a*
• a --requ
uires any uppe
er or lower caase characterr
• * after the
t a --meanss any numberr of upper or lower case chharacters.

AuttoCAD P&ID Cu
ustomization Page 21
b) Example 2:
2 Upper case characcters, any length

Here, checking the


t “Uppercaase” box in the Expression area of the ddialog has chaanged the Ressult to: A*
• A --requuires an uppe
er case characcter
• * after the
t A --means any number of upper casse characterss.

AuttoCAD P&ID Cu
ustomization Page 22
c) Example 3:
3 Upper ca
ase characcters, fixed
d length

In tthis example,, selecting the


e “Fixed Length” checkboxx and incremeenting the spiin control to 3 has changed the
ressult to: AAA
• Each A requires
r an upper case chaaracter.
• The aste
erisk (*) is no longer show
wn.
Thiis expression requires exacctly 3 upper case
c characte er as input. If ttoo few charaacters are inp
put, the missing
chaaracters will be
b representeed by a ‘?’ chaaracter. If too
o many chara cters are inpu ut, the extranneous charactters will be
tru
uncated.

AuttoCAD P&ID Cu
ustomization Page 23
d) Example 4:
4 Numberrs, any length

In tthis example,, selecting the


e Numbers raadio button in
n the Expressiion has changged the resultt to:
N*
• N -requires a digit
• * after the
t N --allowss as many diggits as desired
d.

AuttoCAD P&ID Cu
ustomization Page 24
e) Example 5:
5 Numberrs, fixed length

In tthis example,, selecting the


e “Fixed Length” checkboxx and incremeenting the spiin control to 3 has changed the
ressult to: NNN
• Each N requires a diggit. If too few digits are entered, the va lue will be paadded with leeading zeros.
• erisk (*) is no longer show
The aste wn.
d Length is acctually interprreted as a mi nimum lengtth, rather than an exact len
Note that for diggits, the Fixed ngth. This
is sspecial behavior in order to
o avoid trunccating numeric values. In oour syntax thee following arre equivalent::
NN*
NNN NN

AuttoCAD P&ID Cu
ustomization Page 25
f) Example 6:
6 No Expre
ession

In tthis example, the “No Expre


ession” checkbbox has been selected in thhe “Result” secction. This ressult box now sshows
“Frree Style”. Wh n of the Expression dialog iss being used inn conjunction with a Properrty, it indicate
hen this option es that the
useer should be allowed
a to en
nter any valuee they like forr the propertyy.
th
Thee same thing can be accom mplished by not
n opting to use an expresssion at all (nnot pressing thhe 4 button) when
creeating a subpaart involving a property. When
W this option is used ass a pure expreession, the usser is allowed
d to enter
anyything they like for the subbpart.

AuttoCAD P&ID Cu
ustomization Page 26
g) Example 7:
7 Manuallly Defined Expressio
on

In tthis example,, the “Manually Define Exp


pression” checkbox is seleccted, and thee edit box sho
owing the exp
pression is
no longer disablled.

Thiis option is re nstruct more complex expressions invoolving combin


equired to con nations of chaaracters and n
numerals.

Thee expression above, AANN


Na*, would re
equire the use
er to input:
• Two upper case charracters follow
wed by Two diigits followedd by Any amount (includingg zero) of texxt
characters.
AB10 AB10s
A MM12qwE
a be acceptable input.
would all

nput would fail:


Thee following in
• ab10 --initial charactters should be
e upper case AB10s10 --finnal characterss must be alpphabetic, this ends with
digits
• AB5ss ---only one digit, exactly two
o are required AB345xy --tthree digits, eexactly two are required.

AuttoCAD P&ID Cu
ustomization Page 27
2. Using Expre
essions
Thee first three buttons,
b specifying the pro
operty source e, are mutuall y exclusive. TThe fourth bu
utton, which rraises the
Deffine Expressioon dialog, maay be used eitther alone, orr in conjunctioon with one oof the Properrty buttons.

Whhen an expresssion is used in conjunction with one off the Propertyy buttons, it aacts to enforcce a specific tyype of
inp
put for that Prroperty.

If the expression
n from Exampple 3, requirin
ng three uppe
ercase alphabbetic characteers, were used in conjuncttion with
thee ValveCode property,
p the resulting subbpart would appear
a as folloows:

Notice that both h the Class Prroperty and Expression butttons show thhe raised grap
phics, indicatting that both
h are in
usee. In addition,, notice that the
t expressioon is being sho
own in squaree brackets aftter the propeerty.

Whhen an expresssion is used alone, it acts to require the user to inp ut a pure alphabetic or nu
umeric value w
which is
nott associated with
w any prop perty.

AuttoCAD P&ID Cu
ustomization Page 28
If the expression
n from Examp ple 5, requirin
ng 3 numberss, were used bby itself, the resulting subpart would appear as
follows: Notice that
t the Exprression button n shows the raised
r graphiccs, indicating an expressio
on is in use, bu
ut none of
thee Property buttons show the raised graphics. In addiition, the Fiel d shows ONLLY the expresssion, NNN, an nd does
nott show any prroperty. This is a “pure” exxpression.

D.. Auto-Ge
eneration
n
Som
me values can
n be Auto-gen
nerated. Therre are two ap AutoGenerattion.
pproaches to A

1. SSimple Auto
o-generation
n
Sim
mple Auto-gen
neration has the
t followingg requirementts:
• Every su
ubpart but on
ne is a properrty
• Every property subpaart has a knowwn value
• The onlyy non-properrty subpart is a pure nume
eric expressio n
If these requirem
ments are me
et, it will calcu
ulate a numeric value thatt results in a u
unique Tag.

Thee Tag Format for Nozzles provides


p T Format thhat has been authored to ssupport simp
an example of a Tag ple
Auttogeneration:

AuttoCAD P&ID Cu
ustomization Page 29
2. Property ba
ased Auto-ge
eneration
Pro
operty based Auto-generatted values can be per-Draw
wing or per-PProject.

Exaample 1: Assuume that the Tag for all pu wing must refflect which drawing contaains the pump
umps in a draw p. For
exaample, all pum
mps in drawin
ng 1 should co meric subpart starting from
ontain a num mps in drawing 2 should
m 100, all pum
conntain a numeric subparts starting
s from 200, etc.

Exaample 2: Assu
ume that all Tanks
T in an en
ntire project should
s be num
mbered increementally acro
oss the entiree project.

Botth of these exxamples can be


b supportedd with Propertty based Autoogeneration. There are tw
wo fundamenttal
req
quirements to o use propertty-based auto
ogeneration:
1) You mu
ust define and
d initialize the
e autogen pro
operties
2) You mu
ust indicate in
n the tag form
mat that you are
a using autoo-generation,, and which
property is
i the auto-geeneration bassis

a) Auto-gene
eration ba
ased on Draawing Properties
Youu can access the
t drawing Autogen
A prop ht clicking on the drawing in the Projecct Workspace,, and
perties by righ
selecting “Draw
wing Autogen Properties.”

AuttoCAD P&ID Cu
ustomization Page 30
Selecting Drawing Autogen Properties
P will raise the Drrawing Autogeen Propertiess dialog.

In tthis example,, the “Last Used Value” forr Last Line Nu


umber is initiaalized to 190, and the Increement is initialized to
10.. The auto-generation code looks at the e “Last Used Value”
V and addds the incre ment amount, so the first
autto-generated value will be e 200, not 190
0. Each time an
a auto-generrated value iss used, the prrogram will up pdate the
value stored in “Last
“ Used Vaalue.”

Note that you MUST


M enter vaalues in “Lastt Used Value” and “Increm
ment”, otherwwise the code cannot calculate an
autto-generated value. In thiss example, an
ny attempt to use the “Lastt Valve Numbber” will not ssucceed. For Drawing
Autto-generation
n Properties, you must do this for EACH H drawing.

AuttoCAD P&ID Cu
ustomization Page 31
To use these values, you musst select the Expression bu
utton on the TTag Format Setup dialog, to raise the D
Define
pression dialo
Exp og.

AuttoCAD P&ID Cu
ustomization Page 32
In tthis example,, we intend to
o auto-generaate a numericc value based on a Drawin g Field. To do o so, we selecct the
Draawing Field raadio button, and
a press the e Drawing Field icon. Presssing this icon raises the “Seelect Drawingg Autogen
Pro
operty” dialogg. This dialog presents all the
t defined Drawing
D Autoggen Propertiees already defined, and allows you
to sselect one. Here we can seelect “Last Lin
ne Number”, which we inittialized in thee steps abovee.

In aaddition, new
w Drawing Autogen Properrties can be added by presssing the “New w…” button. This button aallows the
creeation of a new Drawing Autogen Propeerty, but it is necessary to return to thee “Drawing Au
utogen Propeerties”
diaalog to assign their initial values.
v

AuttoCAD P&ID Cu
ustomization Page 33
Aftter selecting “Last
“ Line Num
mber”, the Define Expresssion dialog sh ows the selecction.

AuttoCAD P&ID Cu
ustomization Page 34
Thee default view
w of “Define Tag
T Format” dialog
d doesn’t provide muuch feedback to indicate th hat an autogeen
pro
operty is in usse. It shows th
he expression
n N*, but it do
oes not indicaate that autogeneration iss in effect or u
upon what
value it is based
d. Pressing thee “More>>” button
b does show the addiitional inform mation.

b) Auto-gene
eration ba
ased on Pro
oject Prop
perties
Settting up Projeect Auto-geneeration Prope erties is similaar to setting uup Drawing Au
uto-generatio
on Propertiess, except
thaat there is no project-level UI giving dire
ect access.

AuttoCAD P&ID Cu
ustomization Page 35
Selecting a Proje ect Autogen property
p starts with the “DDefine Expresssion Dialog” raised from tthe “Tag Form
mat Setup”
diaalog, just as ab
bove, except that the “Pro
oject Field” raadio button m
must be selectted.

Preessing the Pro


oject Field ico
on raises the “Select
“ Projecct Autogeneraation Propertty” dialog. This dialog diffeers slightly
fro
om the “Selectt Drawing Autogeneration n Property” diialog in that tthe property A
AND the initial values are shown in
thee same dialogg. You may alsso create neww Project Auto ogeneration PProperties fro
om this dialogg by pressing the
“Neew…” button.

AuttoCAD P&ID Cu
ustomization Page 36
nce Project Au
Sin utogen properties exist once for the entire project, i nitialization iis done from this centralized
loccation, in conttrast to the way
w per-drawiing initialization for each ddrawing in thee project worrkspace.

AuttoCAD P&ID Cu
ustomization Page 37
As with the Drawwing Autogenn properties, selecting the “Last Pump V Value” auto-ggeneration prroperty resultts in that
prooperty being shown
s in the “Define Exprression” dialo
og, but not in the “Tag Formmat Setup” dialog, unless you press
thee “More>>” button.
b

E. Delimite
ers
Eacch subpart off the “Tag Format Setup” dialog
d has spaace for a delim
miter. Most co ommonly, a d
delimiter is a single
chaaracter, such as a dash or colon,
c but the number of chaaracters that may be
ere are no resstrictions on tthe type or n
useed as a delimiiter. The delim
miter is placed in betweenn each subparrt when the taag is built up and stored.

It iss also allowabble to leave th


he delimiter blank,
b howevver there can be situationss in which thiss is inadvisable. Several
othher features in AutoCAD P& &ID may need to parse the e completed tag value bacck down to itss constituent parts, and
it iss possible to create
c Tag Fo
ormats where e this is imposssible. This wiill be covered
d further in th
he “Pitfalls an
nd
Wo orkarounds” section.
s

AuttoCAD P&ID Cu
ustomization Page 38
F. Assigning the Tagg to an Assset
To complete the
e exercise abo
ove, the following Tag Format is being defined at the HandValvess level.

Notice it utilizess most of the features prevviously discusssed.


• The firstt subpart is a property of the
t object, annd requires uppper case chaaracter input.
• The second subpart is a pure num meric expressiion based on a Drawing Au utogen Propeerty.
• The thirrd subpart is a Drawing pro operty.
• The fourth subpart iss a Project Prooperty
• The lastt subpart is a value from a PipeLine. Since HandValvees are inline iinstruments tthat sit upon a PipeLine,
it is adm
missible (althoough perhapss not advisable) to use a prroperty this w
way.
Reccall that the “Drawing
“ Autogen Propertty” called “Last Line Numbber”, being ussed in the seccond subpart, was
inittialized to a Last Used Valu
ue of 190 and
d an incremen on describing Drawing Autogen
nt value of 100 in the sectio
Prooperties. This Tag Format also
a relies on a Drawing prroperty and a Project prop will be initialized as
perty, which w
follows.

AuttoCAD P&ID Cu
ustomization Page 39
Rigght clicking on
n the drawingg icon in the Project
P workspace, and sellecting the “PProperties…” menu item raaises the
Draawing Properrties dialog. In
n the image below,
b the value 51 is beingg assigned to
o the Drawingg’s Area propeerty.

AuttoCAD P&ID Cu
ustomization Page 40
oject propertiies are initialized in the Pro
Pro oject Settingss dialog. Below, the value 18238 is bein
ng assigned to
o the
Pro
oject Numberr.

AuttoCAD P&ID Cu
ustomization Page 41
Aftter a Tag Form
mat has been set up, it must be selected
d as the Tag FFormat to usee for a given P
P&ID class.

Here we see thaat two Tag Fo


ormats are now defined at the Hand Va lves level, an d that the deefault Tag Format for
Hand Vales is “H
Hand Valve Taag [Code-Num
mber].

Sin
nce “Big Exam mple Tag Formmat” was definned at the Haand Valves levvel, it is availaable to be useed by any Hannd Valve.
In tthe following example, the e new Tag Format is assign
ned as the Tagg Format for Ball Valves, o only, by selectting it
fro
om the picklistt for the TagFFormatName property.

AuttoCAD P&ID Cu
ustomization Page 42
Thee following drrawing contains two Ball Valves,
V one off which is on a PipeLine. “A
Assign Tag” iss an option th
hat is
avaailable on the
e right click menu of the Baall Valve.

Selecting “Assiggn Tag” raises the Assign Taag dialog.

As can be seen here,


h the seco ed based on thhe Drawing A
ond propertyy has initialize Autogen Prop
perty. The incrrement
arrrow only appeears when foccus is placed in that subpaart. Each presss of the increement arrow w
will incremennt the
value by the inccrement amou unt specified in the autogeen property.

In aaddition, the Project and Drawing


D ed properties have been innitialized from
base m the values tthat are curreently
asssigned to thosse properties.

AuttoCAD P&ID Cu
ustomization Page 43
Wee defined the ValveCode as requiring up
pper case chaaracters, so e ntering lower case characters appears as an
errror; the text iss presented in
n red.

Notice that the preview


p of th
he completed Tag in the topp box shows the ValveCodde capitalized d. If possible, tthe Assign
Tag g dialog tries to correct miismatched inp
put automaticcally, based oon the expresssion. If correcction is not po
ossible
beccause the missmatch is too egregious (e..g. entering digits
d when chharacters are specified) thee mismatched d input will
stilll be accepted
d. This “weak”” enforcemen nt anticipates a need to som
metimes enteer temporary information that may
fi data in itts final format.
nott reflect the final

Automatic correection, depending on the expression,


e ca
an include paddding short nuumeric valuess with leading g zeros,
dding short alphabetic
pad a inp
put with trailin
ng ‘?’ charactters, truncatinng alphabeticc input that iss too long, and
upp
percasing alp
phabetic inputt.

AuttoCAD P&ID Cu
ustomization Page 44
Rettyping the Vaalve Code in upper case shows that the input is acceptable by displaying the in
nput with blacck letters.

AuttoCAD P&ID Cu
ustomization Page 45
Wh hen we selectt “Assign Tag”” on the second Ball Valve,, the one whiich is not on a pipeline, aggain, some vallues are
pree-populated in the dialog, as they are available from
m the Drawingg and Project,, respectively. Note that th he
auttogenerated value
v has also
o already bee
en populated with the nextt available vaalue.

AuttoCAD P&ID Cu
ustomization Page 46
Thee image beloww shows assiggnments bein ng made to th
he remaining subparts. Sin nce this Ball V
Valve is not acctually
asssociated with any line, fillin
ng in the Pain
nt Code value doesn’t reallly have any m
meaning. We’ll explore thaat more in
thee next section
n.

Forr one final exaample, let’s examine


e a Tagg Format thatt utilizes the ssimple variatiion of autogeeneration.

Thee Tag Format shown beloww has one pro


operty subparrt that will alw
ways contain a known valu
ue, and one ssubpart
wh
hich is a pure numeric exprression.

AuttoCAD P&ID Cu
ustomization Page 47
hen assigningg this tag, the numeric subp
Wh part shows up with the inccrement arro
ow.

AuttoCAD P&ID Cu
ustomization Page 48
Preessing the increment arrow
w produces th
he first numeric value thatt would resultt in a unique tag value.

t find the firsst available u nique tag. Reepeatedly preessing the increment
Thiis type of auto-generation is designed to
arrrow will not change the value of the numeric expression. Every ti me you presss the button, the result retturned will
be the first available unique value, which will be the saame. It is helppful to be awaare of this, ottherwise it might seem
thaat the increment button is not functioning.

AuttoCAD P&ID Cu
ustomization Page 49
G.. Tagging Prompt Behaviorrs and the
e Graphiccal Style

Eacch P&ID Classs Definition sp


pecifies one or
o more Graphical Styles. (These will bee covered in m
more depth in n the
secction on custo
om symbols.) In addition to o the symbolic properties defined by th
he Graphical Style, several
behhavioral prop
perties are alsso defined. On
ne of these in
nvolves the prrompting behhavior for Taggs for that speecific P&ID
class.

Whhile most aspe ects of the Taag are definedd using the Taag Format as described so far, if the Tagging Promptt setting in
aPP&ID class’s Graphical Style e is set to “No
ot a Tagged Component”,
C then the “Asssign Tag” opttion will not b
be
avaailable in the right click me
enu for assetss of that type.

Thee value “Prom mpt for tag duuring compon be raised each time an
nent creation”” will cause thhe “Assign Taag” dialog to b
assset of this typ
pe is placed in
n the drawing.

AuttoCAD P&ID Cu
ustomization Page 50
Thee value “Autoomatically asssign an auto-ggenerated tagg” will not rai se the “Assiggn Tag” dialogg, but will atteempt to fill
in tthe Tag propeerty by filling in all known and autogene
eratable subpparts. Depend ding upon hoow the Tag Format is
deffined, this maay or may nott produce a co omplete Tag.

H.. How Taggs are Sto


ored
Once the Assign n button on thhe Tag Assignn dialog has beeen pressed, there are tw wo types of stoorage which o occur. For
eacch sub part which
w refers to
o a class prop
perty, the indiividual value is assigned baack to that prroperty, as seeen in the
preevious section
n.

In aaddition, all the subparts and


a delimiterrs are concateenated togethher and storeed as a single string in the TTag
PRO OPERTY of the asset. This is shown in th
he data grid image below.

Our second subpart was a pu ure expression, assigned 200 for the firsst Ball Valve aand 210 for the second Baall Valve.
Sin
nce these valu
ues are not baased on any property,
p the ONLY place w where they arre stored is ass part of this fully
commbined stringg, in the Tag property.
p

In o
order to keep
p the Tag propperty synchro he underlyingg properties, many activities will cause the Tag to
onized with th
be rebuilt from its constituen
nt subparts. These
T include
e:
• ng any class property
Changin p of the tagged asseet
• Changin
ng any class property
p of a related
r item that
t is used bby the tagged asset
Chaanges to Draw
wing and Projject propertiees used in the
e Tag Format do not autom matically rebu
uild the Tag. D
Drawing
and
d Project valu
ues, once assigned, are rettained in the completed
c ose properties are later changed at
taag, even if tho

AuttoCAD P&ID Cu
ustomization Page 51
thee Drawing or Project level. In other worrds, when the
e tag propertyy is rebuilt fro
om subparts, only changess to
class-property subparts
s are incorporated..

Exaamples:

In tthis example,, I modify the second Ball Valve


V by assiggning GE as thhe manufactu urer. Notice that the PainttCode
subbpart value ch hanges to a ‘??’. Since this Ball
B Valve is not
n situated oon a PipeLine,, and the Tag Format specified
Pip
peLine.PaintCode, this valu ue is actually blank. In poin nt of fact, it shhouldn’t havee shown the LLTX value eveen after
thee initial assign
nment, but th
he fully forme ed string from
m the Tag Assi gn dialog is aalways assigneed at first.

AuttoCAD P&ID Cu
ustomization Page 52
In tthe next exam
mple, I change
e the PaintCo ode property of the PipeLinne upon whicch the first Baall Valve sits to OIL.
Notice that the Tag propertyy of that Ball Valve
V has upd
dated to refle ct the changee.

Youu may notice that the Pain ntCode property of the line
e doesn’t shoow up in the B
BallValve’s Tag immediately. An
opeeration must occur that triggers the reb
building of the Tag, such aas changing th
he property inn another cell. (This
dellay will be add
dressed in thee future.)

I. Notes on
n Uniquen
ness
Thee tag property, in its entire
ety, is compared for uniqu
ueness with a ll other tags iin the projectt.

Duplicates are not


n allowed in n the same drrawing. Duplicates in diffe rent drawinggs of a single p
project are asssumed to
be different parrts of the sam
me item, for exxample, a line
e which spanss drawings ussing an Off Paage Connecto or could
havve the same tag
t in each drrawing. It wou uld be represented by a si ngle row in th
he data grid.

Note that there is no allowan


nce for items of different types
t to havee the same tagg. In other wo
ords, if a pum
mp were
taggged A-123, and a subsequuent attempt was made to o assign A-1233 as the tag of a Tank, the Tank tag wouuld be
rejeected as a du
uplicate.

Forr nozzles, the Tag value of the owning asset


a is consid with the nozzle tag itself w
dered along w when determining
uniiqueness. In other
o words, two tanks, taagged TK-100 and TK-200 ccan each havee a nozzle taggged N-1,and N-1 will
nott be treated as
a a duplicatee. This is because the program considerrs all of TK-1000N1 and TK-2200N1 when comparing
nozzzle tag uniqu
ueness.

AuttoCAD P&ID Cu
ustomization Page 53
J. Tag Behavior during Cloning
“Cloning” refers to any operation that places a copy of an AutoCAD entity into a drawing. Examples of cloning
include the COPY, ARRAY, and MIRROR commands, Clipboard Copy/Paste (Ctrl-C/Ctrl-V), BLOCK, WBLOCK, INSERT
and EXPLODE.

Since AutoCAD P&ID is a project-based product, copying a tagged asset within a single drawing or between
drawings belonging to the same project would tend to create duplicate tags, which would be rejected.

To avoid this duplication and rejection, the product will blank out both the Tag property, and all the class property
subparts which contribute to the tag. Blanking out the subparts is necessary because automatic tag regeneration
would simply rebuild the duplicate tag if the subparts were left intact.

K. Pitfalls and Workarounds


There are a number of operations which will parse the tag back down into its constituent sub parts. One example is
any operation that presents the sub parts to you for editing. For example, raising the Assign Tag dialog on an asset
that is already tagged (for example to modify the Tag property) presents all the sub parts in each edit box. Another
example is the operation which rebuilds the tag from its subparts whenever one of those subparts has been
changed.

To do this, it has to parse the combined Tag property back down into its constituent parts. It has several ways of
distinguishing between the subparts. One is to compare against the delimiters. Another is to re-retrieve the
property from its original storage and compare the strings.

However, if pure expressions are placed without any delimiter, then it cannot determine where one sub part ended
and the next begins.

If your Tag Format requires that there be subparts which are not delimited, you may need to add a new property to
hold each subpart.

This is important as any refresh of the Tag could result in the loss of the pure expression portions of the Tag.

AutoCAD P&ID Customization Page 54


In tthe following example, the
e Tag Format is defined wiith a Propertyy and a pure n
numeric exprression, but no
dellimiter.

Here,
a Tag baased on this Tag
T Format is being assigned. The concaatenated, un--delimited Taag can be seen
n in the
Data Grrid. “C3333”

AuttoCAD P&ID Cu
ustomization Page 55
Re--raising the Tag Assign dialog illustratess that the purre-expressionn subpart has not been succcessfully parrsed.

In tthe example below, assignning a new property to one


e of the assett’s fields has ccaused the Taag to be recalculated. In
doiing so, the pu
ure expression
n portion of the
t Tag has beeen lost.

AuttoCAD P&ID Cu
ustomization Page 56
If yyou must havee un-delimite
ed subparts, then those subparts shouldd always be b
based on a pro operty. Addinng
pro operties in Au
utoCAD P&ID is straightforrward, and can be accomp lished from the Project Seettings dialog.

L. Special Behavior
B for Line Segment
S Tag Uniq
queness
Line Segments are
a collected into Line Gro oups. This leadds to special bbehavior with
h respect to hhow Line Segmment tags
aree compared fo or uniqueness. In AutoCAD D P&ID, it is actually the Li ne Group thaat is tested fo
or uniquenesss, not each
ind
dividual Line Segment.
S In addition, it is only
o the “Line e Number” prroperty of thee Line Group which is testeed in the
currrent release.. A future rele
ease will expo ose a Tag property on the Line Group directly via thee UI, so that u users can
addd additional properties
p to the Line Grou up Tag.

V.. Annottation Styles


S
Annotations are e implemente ed as regular AutoCAD
A Blocck Reference s and Text enntities, with so
ome additionnal
behhaviors that allow
a the actu
ual textual values shown too be dynamiccally evaluateed based on p properties of tthe item
beiing annotatedd. We call the
e item being annotated
a the
e “target”.

Annotations utilize the same


e mechanism as the Tag Fo
ormats, with a few minor d o specify the property
differences, to
thaat should be shown.
s

A.. Simple Annotatio


A ons
Sim
mple Annotations are creatted by dragging and dropp ping a Data G rid cell onto tthe drawing p
pane. These
annnotations are e not based on e created usinng AutoCAD ttext entities, and the text properties
n any annotation style, are
(font, size, etc.) are based on
n the current AutoCAD setttings for text .

AuttoCAD P&ID Cu
ustomization Page 57
Behhind the scennes, a simple annotation
a Te
ext entity carrries the Form
mat String “TaargetObject.PProperty,” where
“Prroperty” is the property sp
pecified by the Data Grid column
c from w
which the celll was selecteed.

B. Compou
und Anno
otations
d more flexxibility and cuustomizabilityy than Simple Annotations. Creating
Compound Annotations provvide a great deal
an
new Annotatio
on Style has similarities
s to both Tag Forrmat creationn and creation
n of a Symbol for a P&ID o
object.

Annotation Styles are defined at a given class


c level in the hierarchy. Once defined, that style
t P&ID Classs Definition h
can
n be used to annotate
a any target P&ID entity defined at or beloww that node in n the hierarch
hy.

Annotation Styles are also asssociated with


h an AutoCAD provides for their appearance and
D Block Definiition, which p
havior.
beh

Annotation Styles are manipulated from the


t Project Se dit Annotation” raises the Symbol
ettings dialogg. Pressing “Ed
Setttings dialog for
f Annotatio
on Styles.

AuttoCAD P&ID Cu
ustomization Page 58
“Syymbol Name”” is the name of the Annottation Style. This me that appears in the sub
T is the nam bmenu when the
righ
ht-click/Anno
otate… contexxt menu item is selected.

“Block” is the naame of the block definition


n upon which based. The name is always the
h this Annotattion Style is b
Symmbol Name post-pended
p with
w “_block.”” To select a different
d blocck definition, select the Blo
ock edit box, and press
thee more button n.

AuttoCAD P&ID Cu
ustomization Page 59
Doing so will raise a three-step navigation dialog allowing you to choose a drawing, and a block within that drawing,
and alter settings for the annotation to use for the Annotation Style. Once you have selected the block definition,
the contents of that block definition will be cloned into your ProjSymbolStyle.dwg and renamed to
SymbolName_block.

AutoCAD P&ID ships with a file called AnnotationTemplates.dwg. This drawing file contains a number of block
definitions that may be useful as templates for a variety of standard annotation styles, and for which the more
complex settings (the dynamic sizing settings) are already in place.

The “General Style Properties” are the standard AutoCAD entity properties, such as color, layer, and linetype that
will be used when the annotation (an AutoCAD block reference) is created and inserted into the drawing.

The “Other Properties” area of the dialog offer settings that are specific to Annotations.
• “Symbol Scale” is a scale factor at which the annotation will be inserted into the drawing.
• “Use Target Properties” will cause the annotation to be inserted with the same entity properties (color,
layer, linetype) as the target entity, rather than using the settings from “General Style Properties.”
• “Linked” controls whether the annotation moves along with the target entity.
• “Auto Insert” controls whether the annotation will be automatically inserted when the target entity is
inserted into the drawing.
“Auto Insert?” has three possible states, worthy of further discussion.

“No Auto Insert” is self explanatory. Annotations based on this style will never be automatically inserted into the
drawing.

The other two settings are primarily meaningful for the default Annotation Style for a given P&ID class, and take
effect when placing an asset of that class into the drawing from the tool palette.

“Auto Insert With Prompt” --If an asset is placed in the drawing whose default Annotation Style specifies Auto
Insert With Prompt, the user will be automatically prompted to select a position for the annotation.

“Auto Insert” --If an asset is placed in the drawing whose default Annotation Style specified Auto Insert, then the
annotation will automatically be placed in the drawing at the positions specified by “Offset X” and “Offset Y” from
the asset’s insertion point.

The Offset X and Offset Y settings are only enabled when the Auto Insert state is Auto Insert.

Note that the Auto Insert option, relying on the Offset X and Offset Y settings, does not work when the target is a
pipe or signal line. The reason is that the software cannot determine a single insertion point from which to calculate
the offset from a line, as it can do from an asset.

“Auto Insert” using an offset will also have an effect when placing an annotation via the right click “Annotate”
menu. Normally, when using the Annotate… context menu, you would be prompted to select a position using the
mouse. However, when annotating an asset using an annotation style which specifies “Auto Insert” with an X,Y
offset, the annotation will be placed at that offset.

AutoCAD P&ID Customization Page 60


Usee leader indiccates whether a leader will be included with the annnotation.

Oriientation changes how the


e annotation is rotated.

C. Creatingg a New Annotatio


A on Style
In tthis example,, a new Annottation Style at the Hand Vaalves level wiill be created by pressing tthe “Add Ann
notation”
buttton, and then pressing the more butto on beside the Block properrty, as describ bed above. In on dialog,
n the navigatio
select “AnnotationTemplatess.dwg” and press “Open.”

AuttoCAD P&ID Cu
ustomization Page 61
In tthe “Select Bllock” dialog, select
s “InfoTaag2LineBox” as
a the block ddefinition upo
on which we’ll base the neew
Annotation Style.

Note: See the seection ‘Linear Parameters ini Annotation n Block Definiitions’ for subbtle improvem
ments to the a
as-shipped
“Inf
nfoTag2LineBo ox” block defiinition that yo
ou will need to
t make to geet the best poossible resultss when this an
nnotation
is p
placed.

AuttoCAD P&ID Cu
ustomization Page 62
Here, the annottation is given
n the name “V
Valve InfoTagg” and the dessired settingss are made to
o the Style pro
operties.

Preess OK. This will


w copy the block
b on into ProjecctSymbolStylee.dwg and rename it to “V
definitio ValveInfoTag__block”.

Eveery Annotatio
on Style pointts to a unique
e block definittion. Graphicaal Styles (“Sym
mbols”) may share block ddefinitions,
butt Annotation Styles do nott, because the
e Attribute De efinitions for each Annotaation Style need to be set u
up so as to
be unique to thaat Annotationn Style.

AuttoCAD P&ID Cu
ustomization Page 63
D.. Assignin
ng Format Strings to Attribute Defin
nitions
Preessing the “Ed dit Block” buttton allows ed
diting of the Block
B Definitioon upon whicch the Annotaation Style is based. To
sett up for this se
ection, selectt our new Annnotation Stylee, “Valve InfooTag” from the picklist and
d press “Edit B
Block…”

AuttoCAD P&ID Cu
ustomization Page 64
Thiis operation will
w drop you into the Auto
oCAD block ed
ditor for the A
Annotation Sttyle’s block d
definition.

TThis
temmplate contaiins two Attrib bute Definitio
ons, named UNASSIGNED11 and UNASSIG GNED2. It also contains so
ome
geoometry; an un nderline bene eath UNASSIGGNED1, and a box around both Attributte Definitionss. Finally, it coontains 3
lineear paramete ers, each assoociated with a pair of stretcch actions. W
We’ll discuss th
he geometry and parametters in the
nexxt section. Th
he block may have several duplicates directly on top of each otheer (4 duplicatees should be eerased for
thee line, each off the attribute
es and the rectangle).

To fix an action,, right click on


n the action iccon, select Acction Selectioon Set, and then Modify Seelection Set.

Notice that the action as a dootted window w associated with


w it. Re-ccreate the strretch window
w, and make ssure the
objject that need
ds to stretch is selected.

AuttoCAD P&ID Cu
ustomization Page 65
peat the proccess for all of the actions.
Rep

AuttoCAD P&ID Cu
ustomization Page 66
Theese Attribute Definitions currently
c are not
n set up to display any pparticular pro operties of an Annotation’ss target
enttity. Pressing the icon in th
he small toolb
bar will prompt you to seleect an Attribu ute Definition
n. Making thatt selection
will then raise th
he Assign Ann notation Formmat dialog. Thhis dialog is exxtremely similar to the Assign Tag Form mat dialog,
and
d lets you sett up the Attribbute Definitio
on to display properties
p of the target en
ntity, propertties of the Draawing, or
pro
operties of the Project.

Wh hen this dialog is first raise


ed for an UNAASSIGNED Attribute Definittion, the worrd “UNASSIGN NED1” appearrs as the
firsst delimiter. In fact, for Annotation
A ormats, the area between subparts neeedn’t be thou
Fo ught of as a deelimiter at
all. Any kind of free
f text is allowable. Rem
member to rem move or channge this delim
miter value if yyou don’t want any
add ditional text appearing
a whhen the annottation is place
ed in the draw
wing.

Usiing the same skills discusse


ed in definingg a Tag Formaat, we’ll assiggn the target o
object’s Tag p
property to th
he first
Atttribute Definition, and rem
move the word UNASSIGNEED1 from thee delimiter fieeld.

O the value of the UNASSSIGNED1 Attribute Definitiion has been changed to ##(TargetObjecct.Tag).
Aftter pressing OK,
Notice that the linear parameter named UNASSIGNED
U 1 has been eddited in the same way. Wee’ll discuss wh
hy this is

AuttoCAD P&ID Cu
ustomization Page 67
impportant in thee next section
n. You may ha
ave to executte BSAVE in orrder to see thhe linear parameter label cchange.
Thiis is an AutoC
CAD artifact.

Eacch Attribute Definition


D sho t place a single line of texxt, but each line of text maay present more than
ould be used to
onee property. We’ll
W define th he second subbpart to show
w two propertties, one from m the Valve, aand one from the Line
upoon which the Valve sits. Th
he following properties
p and delimiters yyield the formmat string as sshown beloww.

AuttoCAD P&ID Cu
ustomization Page 68
Jusst as with Tag Formats, it iss allowable to
o specify a pro
operty from aanother P&ID D class, so lon
ng as that classs is
directly related to the target object’s class. The second d subpart illusstrates using a property frrom a related class.

Notice that the properties to


o be retrieved
d are enclosed
d inside the fiield identifierrs #(), while th
he delimiterss appear as
free text in betw
ween the field
ds.

AuttoCAD P&ID Cu
ustomization Page 69
It iss also possible to have leading text. You u can add leading text by oone of two m methods. Startt off with an aadditional
Fieeld, and set thhe delimiter on
o the first blaank item. The
e rest of the fiields get filled
d out normally. You can allso select
thee Attribute De efinition in the AutoCAD properties palette, and pree-pend the freee text you w want. In this exxample,
thee free text “MModel No.” is pre-pended.

Clo
ose and save the
t changes to
t the block, and
a OK out of the Project Settings dialo
og.

AuttoCAD P&ID Cu
ustomization Page 70
Now, let’s use this annotatioon. Create a Pipe Line and assign
a a Test Pressure of 2250 using the Data Grid. Pllace a Gate
Vallve on that lin
ne and assign the tag value
e of GV-001, and
a a model number of 8110.

AuttoCAD P&ID Cu
ustomization Page 71
Select the Gate Valve, right click
c and selecct Annotate…
… from the conntext menu. FFrom the sub
bmenu, selectt the
“Vaalve InfoTag” style that we
e have just deefined.

Thee Attribute Definition for #(TargetObjec


# ct.Tag) collected the targeet object’s tagg value. The ssecond Attribute
eplaced #(TarrgetObject.ModelNumber) with 810 annd #(PipeLiness.TestPressurre) with 250. The rest of
Deffinition has re
thee text, both th
he leading texxt and those placed
p using the
t delimiterr boxes, appears unchangeed.

1. Using Expre
essions in An
nnotation Fo
ormat Stringgs
It iss possible to use the Expre on of the Assign Annotatioon Format diaalog to enforcce formatting. Let’s
essions portio
deffine another, simple Annotation Style.

AuttoCAD P&ID Cu
ustomization Page 72
Usiing the same techniques as
a for create Tag
T Formats, expressions hhave been ap pplied to both h the subpartss of this
Annotation Formmat. The firstt subpart speccifies 5 numerals, and the second subp art specifies tthat the prop
perty
ould be upper cased, any amount
sho a of characters.

Thee resulting format string appears as follows:

Thee main differe ence between n using an expression in a Tag Format vvs. an Annotaation Format is that when the
exppression is used for Taggin he act of creating and storring data), thee expression iis used to validate and
ng (which is th
enfforce input. When
W the exppression is use
ed as part of Annotation
A (wwhich reads aand displays eexisting data)) the
exppression is used to format output. The percent sign appears as a symbol after the propertyy, but inside tthe format
string field, to se
eparate the property
p being read from the
t formattinng being requested.

Our Gate Valve already has a model numb ber of 810. We


W will add “B
Bosch” in mixeed-case as the manufacturrer, and
plaace the annotation. Notice how the num
mber has been pre-pendedd with zeros tto make it 5 d
digits long, an
nd the
maanufacturer has been uppe er cased.

It iss possible to use


u the Autog generation po ortion of the Define
D Expresssion dialog w
when creating g an Annotation Format
Strring so long ass you do so in
n combination n with a pure expression, aand not with a property. Reemember tha at
Ann notations REA AD data, theyy do not creatte data, so ussing an autog enerated exppression as paart of an Annootation will
stoore the result ONLY in the annotation
a itsself, and not in
i any underlyying storage. AutoCAD P& &ID will pre-evvaluate
anyy autogenera ated expressio
ons so that they do not con ntinue to increement with eevery refresh o
of the Annotaation.
Wh hile possible, this usage is not
n recommeended.

AuttoCAD P&ID Cu
ustomization Page 73
In tthe image above, notice th
he small dot above
a the Gate Valve.

Thee default Ann e for Hand Valves is “Valve Label”, whicch is defined aas a single Atttribute Definiition
notation Style
shoowing #(Targe etObject.Size). Because there is no size assigned to tthe Gate Valvve, the annotation shows u up as a
dott. Whenever the annotatio on cannot rettrieve a speciffic property, iit shows that property as a dot. As soon as we
asssign a size value to the Gatte Valve, the dot
d will update to show thhat size.

Anyy modificatio
on to a class property
p of the target or th
he class propeerty of a relatted asset will cause the an nnotations
to refresh autom
matically. Thee refresh buttton on the Daata Grid will a lso refresh alll the annotattions in the drawing.

If aan annotation
n becomes dissconnected frrom its targett entity, all thhe properties show the string “No Targeet”.

Thee most comm mon way to caause such an occurrence


o iss to copy an aannotation byy itself, and th
hen paste it in
nto a
diffferent drawin
ng. To re-asso
ociate the ann
notation, sele n Annotation Target.
ect it, right-cliick and then cchoose Assign
Theen choose thee object the annotation
a sh
hould use to read
r properti es.

AuttoCAD P&ID Cu
ustomization Page 74
Thee shortcut no
omenclature TargetObject
T is particularlyy useful for A
Annotations, eeven more so o than for Tagg Formats.
Maany P&ID classes in the sam
me family havve the same properties.
p Foor example, aall Hand Valvees have the Size
pro
operty.

AuttoCAD P&ID provides


p a very simple me ethod to substtitute relatedd P&ID objects; the substittution palettee. Using
thiss tool, one caan easily convvert a Gate Vaalve into a Ball Valve. Now w consider if the Annotatioon for the Gatte Valve
was #(GateValve.Size). Upon substitution to a Ball Valvve, your annootation would d cease showiing the size an nd would
instead show th he dot. The reeason for this is that it is trying to retrieeve a GateValve property, specifically, ffrom a Ball
Vallve. It recognizes the class mismatch, and fails to retturn any dataa. However, b by using #(TarrgetObject.Sizze), data
will be retrieved d for any target entity thatt has a Size prroperty. Thuss, the TargetOObject nomen nclature proviides the
besst possible suupport for maintaining ann notation integgrity in conjunnction with th he substitutio
on palette.

Thee main thingg to remember about Annotations is that the Forrmat Strings in an Annotaation Style’s block
deffinition are always
a used to retrieve and
a display existing
e dataa, never to asssign data to
o storage.

2. Using Annottations to Ed
dit Underlying Data
Once an annotaation has been
n placed, dou
uble clicking on
o that annottation brings u
up a special eeditor.

Double clicking our Valve InfoTag annotattion yields the


e following diialog.

AuttoCAD P&ID Cu
ustomization Page 75
Recall that the first line of this annotation style was based on the format string #(TargetObject.Tag), and that Tags
are themselves built up of subparts as defined in the Tag Format.

The first line of this editor utilizes the Tag Format to break TargetObject.Tag back into its constituent parts and
present those parts for editing.

The second line of this editor directly uses the Annotation Format String to present each part for modification.

Modifications made in this UI are stored in different locations. All PROPERTY changes to the target object’s
properties are actually stored directly back to the underlying storage in the datacache. (Drawing and Project
properties cannot be modified from this dialog.) The changes seen in the annotation are a result of the annotation
refreshing after these values have been changed in their original location.

Modifications to the delimiters are stored in the Annotation itself, and affect ONLY the annotation being edited, not
ALL annotations.

Although it would be odd to use pure expressions in an Annotation Format String, nothing prevents you from doing
so. Be aware, however, that if you use pure expressions without any delimiters in an Annotation Format String, the
program will have the same problem reparsing the annotation into its subparts as it has when parsing Tags, and you
may get unexpected results in the Edit Annotation dialog.

3. Special Behaviors --Reducer Annotation Styles


AutoCAD P&ID ships with 4 standard annotation styles for Reducers:
• Fixed Reducer Style
• Large by Small Reducer Style
• Flow Based Reducer Style
• Adjacent Pipe Reducer Style
The first of these is based on the properties of the reducer itself. The Annotation Format String for Fixed Reducer
Style is: #(TargetObject.Size1)x#(TargetObject.Size2).

The other three styles are “Pipe Based” reducer styles, and AutoCAD P&ID applies special rules when evaluating the
format string, which is the same in all three styles: #(PipeLines.Size)x#(PipeLines.Size).

For these special Annotation Styles, even though the same property appears twice in the format string, the
program will collect the sizes from the two separate pipelines attached on each side of the reducer. It will then
calculate, based on the name of the reducer style, which size value should be shown first.
• Large by Small Reducer Style --Shows larger size value first always.
• Flow Based Reducer Style --Shows the size value of the incoming pipe first.
• Adjacent Pipe Reducer Style --Shows the size values on each side for the pipe on that side.
Users may create other pipe based reducer styles that show additional data. In order for it to recognize such styles
and apply the special processing, the following must be true:
• The Annotation Style must be defined at the Reducers level in the class hierarchy
• The Annotation’s target must be a Reducer.

AutoCAD P&ID Customization Page 76


• The Annotation Style’s name must begin with:
o Large By Small Reducer
o Flow Based Reducer
o Adjacent Pipe Reducer
• The Format string must contain exactly one delimiter
• The Format string must contain a property #(PipeLines.Property) on each side of the delimiter.
• The Format string may contain other properties, as long as the properties on each side of the delimiter are
identical and in the same order.
It is not recommended to use the Edit Annotation dialog to modify the values of Pipe Based Reducer annotations,
as this dialog cannot distinguish to which pipeline the new size value should be assigned.

E. Principles of Dynamic Sizing


In the Annotation examples above, several geometric items dynamically changed size to match the evaluated
values of the attributes. When the “Valve InfoTag” Annotation Style was placed in the drawing, the underline under
GV-100 matched the width of the text, and the box fit nicely around all of the evaluated text.

AutoCAD P&ID leverages the AutoCAD “Dynamic Block” feature in custom ways to enable this behavior. Dynamic
block definitions are defined in such a way that each block reference (aka insert) of that block can be independently
manipulated in ways that change its appearance, for specific sub portions of the block.

The AutoCAD Dynamic Block feature is extensive and will not be covered in depth here, but it is recommended that
interested users spend some time studying the documentation and/or taking an AU course on this feature.
Authoring a dynamic block has nearly as much power and potential complexity as writing computer code!

1. A brief overview of Dynamic Block Principles


Creating a Dynamic Block Definition in AutoCAD involves placing and defining several items in the block definition
which are not geometry. These items are known as “parameters” and “actions”.

There are a variety of different types of parameters, each of which track some set of properties, for example:
• Linear parameters have a length
• Rotational parameters have a rotation.
• Point Parameters have a position.
Each parameter can be associated with one or several types of actions. Typical actions include:
• Stretch
• Move
• Rotate
• Flip
Each action is associated with an “action frame”, which indicates which geometry within the block definition
participates in the action, and in what fashion. The available actions may be presented to the user as a special grip
on the block insert, or the grips may be hidden from the user, depending upon whether the block author intends.

AutoCAD P&ID Customization Page 77


Forr each block insert, the pro operties trackked by the parameter mayy have differeent values. A ssingle block d
definition
witth a single Lin
near Paramete er may be insserted into an
n AutoCAD drrawing multip ple times, and
d the length oof the
lineear paramete er may be diffferent in each h block insert. Depending uupon that len
ngth, actions associated with the
lineear paramete er will yield diifferent resultts.

Thee list above iss by no meanss exhaustive. The AutoCAD D P&ID Annottation featuree extends thee behavior of Linear
Parrameters, so thet remainde er of the discu
ussion will foccus on those..

2. Linear Param
meters in An
nnotation Block Definitiions
In ttruth, AutoCAAD P&ID makes only a sligh ht tweak to th
he behavior oof Linear Paraameters. It recognizes wheen an
Atttribute Definition caries an n annotation Format Stringg. If the blockk definition al so carries a liinear parameeter whose
lab
bel is identical to the Attrib bute Definitio
on, then in each block referrence, after the format strring has been n
evaaluated, it willl set the lineaar parameterr to be the sam
me width as tthe evaluated d value.

In o
other words:

In tthe block definition you may


m have a forrmat string #((TargetObjectt.Tag), 19 chaaracters long, but which beecomes
GV ers long. In the block refereence, the lineear parameterr will be set to the
V-001 in the block referencce, 6 characte
len
ngth equal to the six characters.

Lett’s look at a siimple examplle, the “Oval Tag


T Style” An
nnotation Stylle. Using the skills discusseed above, navvigate to
thee Engineeringg Items node in
i the P&ID Objects
O Definitions class hieerarchy, selecct the Oval Annotation Styyle, and
preess the Edit Block button.

AuttoCAD P&ID Cu
ustomization Page 78
Thee block editorr shows an ovval shaped pie
ece of geome etry consistingg of line and arc segmentss, an Attributee
Deffinition carrying the #(TarggetObject.Tagg) format string, and a Lineear Parameteer also carryin
ng the
#(TTargetObject.Tag) format string.
s The Lin
near Parametter is associatted with two stretch action ns.

Selecting the strretch action on


o the left higghlights the sttretch action itself, the paarameter with h which it is associated,
and
d the geomettry which is participating in n the action. A small recta ngle shows th he “action fraame” for this action.

Forr stretch actio


ons, the ruless are as follow
ws:
• ot selected byy the action are not modifiied
Entities which are no
• Entities which are se
elected by the
e action and are
a completelly inside or co ompletely outtside the fram
me are
moved.
• Entities which are se
elected by the
e action and which
w cross thhe frame are stretched.
In tthe example above,
a when the left side of the
the arrc on the left side of the ovval is complettely inside thee frame, so w
lineear paramete
er moves right or left (depe ending upon how the overrall linear parrameter is sized) the arc w will move.
Thee line segmen
nts at the top and bottom of the oval crross the lineaar parameter,, so they will sstretch.

Forr completene
ess, we highligght the other stretch actio
on as well.

Thee right hand stretch


s action
n also selects the top and bottom
b lines, but selects tthe arc on thee right hand sside of the
ovaal.

AuttoCAD P&ID Cu
ustomization Page 79
Selecting the linear parameter itself and raising the properties palette shows some special settings specific to the
linear parameter.

Notice that the endpoints of the linear parameter are actually slightly inside the edges of the geometry, rather than
directly on the edges. Doing this ensures that there will be some space around the text when the stretch actions are
applied. If the linear parameter were exactly on the edges of the geometry, then when the parameter is sized to
match the attribute’s width, the geometry will exactly enclose the attribute, which usually doesn’t look very good.

Note: The InfoTag2LineBox block definition in AnnotationTemplates.dwg used in part C., “Creating a New
Annotation Style” actually shipped with this very problem. To get the best results, you may need to adjust the end
points of the linear parameters to be inside the box, and assure that the Base Location property on each is
“midpoint”, as discussed below.

AutoCAD P&ID Customization Page 80


Thee property caalled “Distance Label” is the property thhat must matcch the Attribu ute Definition
n’s format strring. If
theese values eveer fail to matcch, then the linear parame
eter will not bbe associated
d with the Attribute Definittion. You
cann use the property palette to fix such errrors, should they occur.

Thee linear parammeter’s Base Location property can be start point o r midpoint, and indicates how the lineaar
parrameter will be
b anchored asa its size is changed. In most
m of our sh ipping annotation templattes, we use a midpoint
ancchor for the linear parameeter, and centter-justify the
e Attribute Deefinition at th
he same X Vallue. This combination
ressults in the ge
eometry controlled by the linear parameter staying ccentered on tthe attribute..

AuttoCAD P&ID Cu
ustomization Page 81
Thee linear param
meter’s Show w Properties property
p conttrols whetherr the linear paarameters prooperties will be shown
in tthe propertie
es palette of the block reference. Generrally, the annootation block definitions w
we ship have tthis value
sett to No, becau
use the block reference’s parameter’s
p properties
p aree being contrrolled program
mmatically, and user
moodifications made
m via the property
p palette would not “stick”. How wever, settingg this propertty to Yes can be
exttremely helpfful when you are first authhoring, and te
esting, your dyynamic blockks.

Thee linear param


meter’s Chain
n Actions property is an ad
dvanced propperty, and ind
dicates wheth
her the param
meter can
be controlled byy another parrameter in the
e same block definition.

Thee linear param


meter’s Numb ber of Grips property
p indiccates how maany grips should be shown n for each blo
ock
refference placed
d in the draw
wing. The nummber and type e of grips diffeers dependingg upon the tyype of parameeter and
thee number of associated
a acttions. Becausse the linear parameter
p is ggoing to be p
programmaticcally controlleed, we ship
ourr annotation block definitions with the number of grrips set to zerro for our lineear parameteers.

Here are several examples off this annotattion style inse


erted into thee drawing.

Thee Gate Valve has a short taag value, and the Ball Valvve has a very llong tag valuee (based on o our “Big Exam
mple Tag
Forrmat” above.) As can be seeen, the oval has stretched d to fit aroun d the text, with a bit of paadding.

AuttoCAD P&ID Cu
ustomization Page 82
Forr illustrative purposes,
p I en
nabled the “Show Propertiies” setting inn the block deefinition, and show the pro
operties
forr the two blocck references below.

Notice the propperty under th he “Custom” heading


h called #(TargetObbject.Tag). In this case, you
u are being sh
hown the
“Diistance Label”” of your linear parameterr as the prope erty name, annd the actual width of the linear parammeter as
thee value. Whenn you first beggin authoringg dynamic bloocks, you mayy find it helpfu
ul to have this enabled, an
nd to make
maanual changess to the width h of the linearr parameter, in order to prreview how yyour actions wwill behave att various
widdths.

Dirrectly below, under the Atttributes head


ding, you see the attribute for #(TargetO Object.Tag), aand its curren
nt text
value. Selecting this item and
d clicking the ellipsis butto
on will raise thhe Edit Annottation dialog for that attrib
bute.

3. TTotalX and TotalY


T
Theere are two special namess that AutoCA AD P&ID unde erstands for li near parame ters, in addition to those n
named to
maatch Attribute
e Definition’s format stringgs. Let’s review the block ddefinition for our Valve InffoTag annotattion style.

AuttoCAD P&ID Cu
ustomization Page 83
Notice the two linear parame
eters named TotalX and To
otalY.

In aaddition to ussing the widthh of an evaluaated format string


s to set tthe width of aan associated linear param
meter,
AuttoCAD P&ID alsoa calculate es the combinned extents off all the evaluuated format strings in thee entire blockk
refference. If it encounters
e thhe TotalX lineaar parameterr, it sets its sizze equal to th
he width of th
hose combineed extents.
If itt encounters the TotalY lin
near parameter, it sets its size
s equal to the height off those combiined extents.

ox that surrouunds several fformat strings.


Thiis can be usefful, as in this example, for creating a bo

Note that TotalX w not collecct the extentss of other texxtual entities in the block; only those asssociated
X and TotalY will
witth format strings.

VI. Custo
om Sym
mbols
A.. Creatingg Custom Symbolss
1. Block Definiition Managgement
Theere is a difference between how Block Definitions arre managed ffor Annotatio ons vs. Graphiical Styles. Byy default,
eacch Annotation n Style is alwaays associated with a unique Block Def inition. When n creating a n
new Annotatio on Style, if
youu select a Block Definition for an Annottation Style thhat already exxists, the prod
duct will auto
omatically maake a copy
of tthat Block Deefinition for yoou to modify.

In ccontrast, Graphical Styles are designed to share Blocck Definitionss. If you creatte a new Grapphical Style an
nd select
thee Block Definition for an exxisting Graphical Style, botth the old andd new Graphiical Style will use that one Block
Deffinition, and changes
c to th
hat Block Defiinition will afffect both Graaphical Styles..

Thee reason thatt an Annotatio on Style automatically creaates a new Bllock Definitio on is that usuaally, each Ann
notation
Styyle will define
e different Atttribute Definitions with diffferent Formaat Strings, thu
us each Anno otation Style mmust have
its own Block De efinition.

On the other haand, Graphicaal Styles were designed witth the assumpption that useers would mo ost often wannt to create
sevveral different graphical sttyles for the same P&ID claass which difffer only with respect to the other style

AuttoCAD P&ID Cu
ustomization Page 84
operties, such
pro h as color, layyer, linetype, but which wo
ould otherwisse want to shaare the samee image. This iis best
acccomplished by sharing the block definittion.

2. C
Creating a new
n Graphiccal Style with
h a new Sym
mbol
Givven the Block Definition haandling of Graaphical Styless, it follows thhat to create aan entirely neew symbol, one must
firsst create a new Block Defin
nition.

Usee the method dology of your choice to crreate the new


w Block Definiition. In the fo
ollowing exam
mple, the Block
Deffinition for th
he PIP Screw Pump
P has beeen copied andd the copy haas been renam med and mod dified. The neew Block
Deffinition has seeveral lines added to the pump
p body. Both
B versionss are shown.

Rem
member to saave the drawing in which you
y have defiined the new
w block definittion.

AuttoCAD P&ID Cu
ustomization Page 85
Thee next step is to add a new
w Graphical Sttyle for the Sccrew Pump cllass based on
n this Block Deefinition. Raisse the
Pro
oject Setup diialog and navvigate to the SCREW
S PUMP P node under P&ID Object Definitions.

AuttoCAD P&ID Cu
ustomization Page 86
Preessing the Add Symbol buttton raises the
e Browse dialog. Navigatee to the curren
nt project’s projsymbolstyyle.dwg.

Typ
pe in a name (Reversible Screw
S Pump Style).
S

AuttoCAD P&ID Cu
ustomization Page 87
Thee new style iss has now bee
en created in the Project Setup
S and is aavailable.

Forr the final step, press the “Add


“ utton to placee a button on the Tool Paleette which wiill create a
To Tool Palette…” bu
scrrew pump using this new style.
s

Thee following diialog indicate


es that the too
ol has been successfully addded, but be aware that itt will be added to the
botttom of the palette
p group currently acttive, and you may need to reposition in
n using drag/ddrop into the desired
loccation on the palette.

AuttoCAD P&ID Cu
ustomization Page 88
Pumpp after being moveed

Initial position at the bottom


m of the current too
ol palette

Thee product will do its best to provide a reasonable bittmap on the ttool palette ffor the new toool, but you m
may want
to modify the immage. Using the tools of yo our choice, yo our new tool. Right
ou can designn a bitmap to represent yo
cliccking on the Tool
T and seleccting “Properrties…” will raaise the follow
wing dialog.

Fro
om here, you may right clicck on the imaage, and selecct “Specify Im
mage…” This w
will raise a navvigation dialo
og in which
you
u can select the image of your
y choice fo
or the tool.

AuttoCAD P&ID Cu
ustomization Page 89
3. G
Graphical Sttyle Propertties

Ab
brief descriptiion of the rem
maining Graphical Style pro
operties folloows:
• Symbol Scale: This is the default scale
s factor att which the syymbol will bee inserted.
• n Insert: This controls whe
Scale on ether the userr will be prommpted to scalee the asset when it is drop pped from
the Toool Palette. If th
he user declinnes to manually scale the aasset, the deffault scale facctor specified
d in Symbol
Scale will be used.
• Scale Mode:
M This is only
o enabled whenw “Scale on
o Insert” is sset to Yes, an
nd controls whhether non-u uniform
scaling (scaling
( differrently in X and Y) is allowe
ed.
• Rotate on
o Insert: Con ntrols whethe er the user will be promptted to rotate tthe asset wheen it is dropp ped from
the Toool Palette.
• Mirror on
o Insert: Con ntrols whethe er the user wiill be prompteed to mirror tthe asset wheen it is droppped from
the tooll palette.
• Taggingg Prompt: Con ntrols whetheer the asset caan be tagged,, and whetheer the user will be automattically
prompted to fill in taag values whe en the asset iss placed fromm the Tool Palette.
• Join Typ h the assett is expected to join with tthe line. In recent release more emphases has
pe: Specifies how
been givven to ‘Join Type’
T propertyy of any P&IDD symbol to coontrol the beehavior of sym mbols especiaally the
graphicaal representaation with respect to line.
o Endline: Asset remains stationary whe en line is movved. Moving t he asset or thhe line causess the line
to elbow. Eraasing the line
e does not eraase the asset..
o Inline: Asset cleans the lin
ne without brreaking it. Mooving the linee causes the aasset to movee as well.
Erasing the line erases thee asset.
o Segment Bre eaker: Insertss into a line an
nd breaks thee line into two o segments in
n the same grroup.
Retains the line group and d line numbe er for both lin e segments. Example: Speec Break, etc.
o Segment Gro oup Breaker: Inserts into lines
l and breaaks line into ttwo segmentss and two linee groups.
Example: pumps, blowerss.

AuttoCAD P&ID Cu
ustomization Page 90
o No Join: Doe
es not connecct with lines.
• Auto Noozzle: Indicate
es whether a nozzle should d automaticaally be created d when a linee joins this assset. Nozzle
creation
n adds a row to the datacaache.
• Auto Noozzle Style: Sp
pecifies the sttyle of nozzle that should bbe generated d. The “Assummed Nozzle Sttyle” does
not generate graphiccs (useful if th
he nozzle is allready part off the asset graphics), but d
does add a ro ow in the
data cacche for the no
ozzle.

4. Manually sw
witching bettween Graph
hical Styles
Havving created the additionaal symbol for Screw Pump,, place a screw w pump in thhe drawing. Seelect the screew pump
andd raise the prroperties pale
ette. The prop
perties palette will show bboth the origin
nal style “Screew Pump Styyle” and
thee newly created style, “Revversible Screw
w Pump Style e”. You can usse the Tool Paalette to selecct either Stylee, and the
selected Screw Pump will draawing using the selected Style.
S

5. A
Associating Graphical Styles with a Property
Thee ability to haave multiple Styles
S available for a given P&ID object type is generrally useful, b
but becomes mmore
powwerful when these variouss graphical re epresentation ns are combinned with a speecific propertty. Each P&ID Object
Deffinition can have
h a single Property
P defined that is off the “Symboll List” type.

Raiise the Projecct Setup dialo


og, navigate to
o the Screw Pump,
P and addd a new Prop
perty.

AuttoCAD P&ID Cu
ustomization Page 91
Thiis raises the “Add
“ Propertyy” dialog. Sele
ect “Symbol List”
L as the tyype, and enter “Reversible” for the prop
perty
nam
me and its de escription. Then press OK.

Thee “Symbol Lisst Property” dialog


d allows you
y to definee the items in the list. This property is similar to a “Selection
Listt”, except thaat each prope
erty VALUE allowed defined for the pro perty is assocciated with a specific Grapphical
Styyle. Using the “Add Row…”” button, and define two values,
v “Yes” aand “No” for the “Reversib ble” propertyy.

Aftter adding the


e rows for “Yees” and “No”,, the Symbol List Property dialog showss the rows that have been defined.
Forr each row, all the Graphiccal Styles thatt have been defined
d for a SScrew Pump aare shown ass options under the
“Block Value” coolumn. Selectt the new “Re ew Pump Stylee” to be assoociated with the “Yes” valu
eversible Scre ue of the

AuttoCAD P&ID Cu
ustomization Page 92
w Reversible property, and
new d select the original
o “Screw
w Pump Stylee” to be assocciated with th
he “No” valuee of the
new
w Reversible property.

Ok out of this diialog. Back in the Project Settings,


S the new
n propertyy is shown. Seelect No as the default valu
ue.

e the original representation. Open thee data grid and scroll to


Plaace a Screw Pump in the drrawing. Initially it will have
thee right. The ne
ew “Reversible” property is shown. Selecting the “Y es” option will cause the aalternative style to be
shoown. (You ma ay have to clicck in the draw
wing pane to trigger
t the reedraw of the SScrew Pump.))

AuttoCAD P&ID Cu
ustomization Page 93
Theere need not be a one to one
o correspon ndence between the propperty values and the Graph hical Styles. This exact
tecchnique is use
ed to implemeent the “Norm
mally” properrty of Hand V
Valves in the p
product. The “Normally” vvalues
incclude 3 open and
a 3 closed variants, but only two Graaphical Styles (one open annd one filled) are used to rrepresent
eacch of the 3 op
pen and close
ed values.

6. Using Multiple Graphica


al Style for an
a Asset thaat Spans Draawings
Another use of multiple Grap
phical Styles is to support a single assett that spans m
multiple draw
wings.

Usiing the techniques above, three additio or the Vessel class. The deefault
onal graphical styles are deefined here fo
graaphical style is a tall, verticcal vessel. The
e three new styles
s are shoown below.

In a project conttaining three drawings, plaace a vessel in each drawi ng. When pro ompted, assiggn each vesseel the same
Tagg value, TK-1000. When the e second attemmpt is made to
t assign thiss tag value, w hich is a dupllicate, it recoggnizes the
facct that the Tagg value is alre
eady in use, although in a different
d draw
wing, and queeries you as tto whether th hese assets
aree really meant to represent portions of the same assset, with the ffollowing diallog.

AuttoCAD P&ID Cu
ustomization Page 94
Select “Assign th
his tag to the selected com
mponent” for each vessel.

In tthe image above, a differe


ent Graphical Style has beeen assigned too the vessel in each drawing, so that eaach
draawing shows the
t bottom, middle,
m and top of the Vesssel respectivvely. Howeverr, note that in
n the Project View of
thee data grid shown, there iss only one inte
ernal represe
entation (PnP ID) for the veessel. Thus, th
he single vesssel spans 3
draawings, with an
a independe ent and approopriate repressentation in eeach drawingg.

7. A note abou
ut Attachme
ent Points
Atttachment Points in the blo
ock definition of a graphicaal style have ttwo purposess.

de snap pointss. When you begin drawinng a PipeLine from a piece of equipmen
Thee first purposse is to provid nt, any
Atttachment Point in the equipment’s blocck definition functions
f as a snap point.

Additionally, forr assets that have


h ection, the naaming of the Attachment PPoints is impo
flow dire ortant. The vaalidation
feaature, when completed,
c will interpret th he flow directtion of an assset as going frrom Attachm
mentPoint1 to
AtttachmentPoin nt2, and will use
u this to reccognize situattions in whichh an inline as set’s flow direction is in co
onflict with
thee flow directio
on of the line upon which it sits. Validattion will also check for linee connectionss at the attacchment
poiint to determ
mine if a line iss fully conneccted to an assset.

AuttoCAD P&ID Cu
ustomization Page 95
nally, some asssets, such as Hand Valves,, support the “End Connecctions” propeerty. This prop
Fin perty allows ffor various
endd connection graphics to be
b drawn on thet valve. The ese graphics aalso rely on th
he attachmen nt points in order to
dettermine wherre to draw. Inn addition, the
ey rely on the
e label of the attachment p point to determine at whaat angle to
draaw. The intention to suppo ort endcodes is indicated by
b adding a coolon, the worrd EndCode, aand an angle,, in
couunterclockwisse degrees, too the attachm
ment point. Thhus, an attachhment point llabel could bee:
AtttachmentPoin nt1:EndCode1 180.

Thee following exxample shows attachmentt points with endcodes deffined for both d a 4 port valve.
h a 2 port and

B. Dynamicc Assets
e principles discussed in bo
Dynamic Assets combine the oth Annotatioon Styles and Graphical Styyles.

ADDynamic Asse et is an asset which


w intrinsiically includess textual elem
ments based oon the asset’ss properties aas part of
thee asset itself. As the valuess of the asset’’s properties change, the ttextual repressentation of tthose values update as
weell. One of thee main motivaations for deffining a Dynam mic Asset, as opposed to u using a regulaar asset comb
bined with
an Annotation iss that the texxt is fully integgrated with th nnot be moveed away from the asset.
he asset grapphics, and can

AuttoCAD P&ID Cu
ustomization Page 96
As with an Annotation, the properties to retrieve are specified using a Format String, associated with an Attribute
Definition, as part of the Block Definition for the symbol. All Format String syntax is supported. The target object
used to evaluate the Format String is the Dynamic Asset itself.

Including a Format String in the Block Definition of a Graphical Style is sufficient to alert the program to create a
Dynamic Asset when the asset is placed in the drawing. There are no other settings that need to be touched, no
other support required.

Also, it is perfectly safe to modify the Block Definition of a Graphical Style to add or remove Format Strings. After
the changes are made, the program will automatically convert all the existing assets in the drawing between being a
Dynamic or a regular Asset, depending upon the current Block Definition.

1. Special Behaviors of Off Page Connectors


In AutoCAD P&ID, the Off Page Connectors are special types of Dynamic Assets.

First, the special “use mate” syntax is included in the Format String of the Block Definition, in order to show values
from the “other” drawing in which the mated connector resides. This syntax is not supported by the “Assign
Annotation Format” dialog, and must be inserted manually while editing the block definition.

For example:
#(Drawing.General.PnID)
#(=Drawing.General.PnID)
The first Format string would return the PnID (drawing number) of the drawing in which the target object resides.

The second Format String would return the PnID (drawing number) of the drawing in which the target object’s mate
resides.

The equal sign just inside the opening parenthesis specifies “use mate’s property.” Naturally, if the target object is
not a mate-able type, then this format string will not evaluate, and the DOT will be seen instead.

AutoCAD P&ID Customization Page 97


In tthe image below, the conn
nector on thee left, in drawing 1, automaatically shows the value 2 inside the rigght side of
thee arrow, and the
t connecto or on the rightt, in drawing 2, automaticaally shows the value 1 inside the right sside of the
arrrow, because these connecctors have be een mated.

Seccondly, the im
mplementatio on of the shipping connecttor types incluudes some sp pecial coding tthat is relevant to
exaactly the combination of graphics and Format
F Strings in our shippping OPC symmbols. For exaample, the Clo osed Drain
sym
mbol ships with Format strrings defined,, from top to bottom, to shhow the conn nector numbeer, the destin nation line
serrvice code, annd the mate’ss drawing num mber. In the im mage below, the default o or “right side up” orientation is
shoown on the le eft, and the drain on the right is inverte
ed due to its loocation on a downward flo owing line. Notice,
thoough, that thee values read in the same top
t to bottom m order on thhe second draain, in spite off it being inveerted. This
behhavior is speccific to our shipping symbools, and is unffortunately noot user extennsible at this ttime. For this reason,
andd also becausse the dynamic blocks for thet Off Page Connector
C arrrows are amo ong the mostt complex shipped in
thee product, exttensive modiffication of theese blocks is discouraged.
d Minor modiffication such as font changges can be
succcessfully accomplished byy most users, but major sh hape changes should be un ndertaken only with a good
undderstanding ofo Dynamic Block authorin ng, and after making
m a backkup. Repositi oning, changing, or erasing any of
thee specific prop
perties displaayed in our sh
hipping OPC blocks
b may caause the auto matic re-orientation of tho ose
prooperties to fail.

AuttoCAD P&ID Cu
ustomization Page 98
If the exact commbination of properties,
p po
ositions, and behaviors
b is ttoo difficult to
o accomplish in the connector’s own
Bloock Definition
n, a combinatiion of the assset and annottations can offten be used tto accomplish h the desired results.

2. SSpecial Beha
aviors of Insstruments
General Instrumments, and the
e bubbles forr Inline Instruments, exhib it special beh
haviors which are not user
odifiable in this release.
mo

Wh hile placing a general instrument, an ad dditional prommpt is availabble by which tthe instrumen nt can be attaached to a
linee segment or another asse et via a Leade er. In the case
e of General Innstruments aattached to a Pipe Line, thee leader
linee is part of the General Insstrument itself, and is drawwn by the Ge neral Instrum ment. When a General Insttrument is
attached to ano other asset viaa a leader, the leader line will be insert ed as a piecee of Tubing.

Wh hen an Inline Instrument, such


s as a maggnetometer iss placed, the product prom mpts for a position for the default
annnotation, whiich is the instrument bubb ble. After placcement, the pproduct places a leader bettween the bu
ubble and
thee annotative bubble.
b In this case, the leader is actually a separatee AutoCAD Leeader entity.

Forr both Generaal Instrumentts and the ann notative bubbble of Inline I nstruments, tthe product eenforces a ho
orizontal
orientation of thhe contained text, regardle ess of the ancchorage of thhe bubble. In other words, a bubble ancchored to,
or inline with, a vertical pipeline will still have
h text thatt reads horizoontally.

Thiis differs from


m the default behavior for annotations, in which a veertical target results in verrtical (bottom
m to top)
orientation of thhe text.

VII. Prop
perty Propagation/Acq
quisitio
on
Forr some P&ID classes, their properties arre closely associated with the propertiees of anotherr P&ID class.

Forr example:

AuttoCAD P&ID Cu
ustomization Page 99
Botth P&ID Hand
d Valves and Pipe
P Lines havve a size prop
perty.

Youu may want the size prope erty of the Haand Valve to automatically
a y acquire the ssame value as the Pipe Lin
ne upon
wh
hich you place e the valve. Siimilarly, if you
u modify the size propertyy of a Pipe Lin
ne, you may wwant the Pipee Line to
auttomatically prropagate that size value to o all the hand
d valves on thhat line.

On the other haand, there cou ons in which you want thee size propertty of the Pipe Line and the Valve to
uld be situatio
difffer.

Thee fundamentaal rules are: Property


P prop
pagation and property acq uisition are the same conccept, when co omponent
Appropagates itss value to com
mponent B; itt means comp ponent B acquuires its valuee from compo
onent A. The
Acq
quisition type
e property allows the user to specify a RULE
R as the m
means by whiich a propertyy of an instan
nce gets its
value.

To add Acquisitiion property, open Projectt Setup and select Add buttton in P&ID C Class Definition. In Add Prroperty
diaalog create a new
n propertyy of the type ‘Acquisition’.
‘ This will takee you to selecct data sourcee where you ccan select
ap Y can select Class, Drawing or Projectt property to acquire from
property to accquire from. You m.

Thee acquisition rule defined can be seen in the Propertties list from the defined p property under ‘Acquisitioon’ column.
Thiis cell also allo
ows removingg or editing acquisition rulle by clicking on the button in the cell w
which has twoo options;
‘Reemove acquisition rule’ and ‘Edit acquissition rule’.

Thee Acquisition property type also supporrts the concept of “Initializzation Only”, where the in
nstance first aacquires
thee value from its
i source and d immediatelyy goes to the Override moode.

Acquisittion propertie
es can get the
eir values from wing properties, or PnID Class
m Project prooperties, draw

AuttoCAD P&ID Cu
ustomization Page 100
Propertties.

AuttoCAD P&ID Cu
ustomization Page 101
• When an instance prroperty is at the t “Acquire” mode, changges to the sou urce are pickeed up by the instance
that is acquiring.
a In this
t mode the e data is in Re
ead-only form mat and canno ot be entered d manually.
• When an instance prroperty is at the t Local mod de called as “O Override” mo ode, changes to the sourcee are NOT
picked up
u by the insttance doing the acquiring. This mode leet you enter n new values m manually, but rremember
changess made here do d not get pu ushed back to o source prop erty.
• Acquisittion rule can be edited or remove via Project Setup.
• Acquisittion propertyy is just another type of pro operties, if yoou setup a (Accquisition) prroperty at thee
Enginee eringItems levvel, all Class Definitions
D be
elow that leveel will inherit the property.

VIII. App
pendix
A.. Format string syn
ntax
Thee following fo
ormat string syntax
s allows identification n/tokenizatioon of retrievabble properties, formattingg/input
rules, auto-geneeration, and assign-back
a by the Assign Tag
sttates. (This is the underlyinng syntax thaat is created b
Forrmat/Assign Annotation
A Fo
ormat dialogss.) Knowledge e of these dettails may be u
useful for devvelopers whoo wish to
pro
ogrammaticallly create formmat strings fo
or their own features.
f

Whhile there is an overarchingg syntax, porttions of the syyntax are moore appropriate to Tag Format strings. In
parrticular, the assign-back
a to
oken should be
b used only with
w Tag Form mat strings, n ever with Annotation Form
mat
strings. (This tokken is hidden in the variou
us Tag Formatt UIs.)

Thee auto-generaation token may w either, but has few if any use cases for Annotattions.
m be used with

AuttoCAD P&ID Cu
ustomization Page 102
The formatting token is used by several dialogs as a means to enforce input for Tag Formats, but is used to apply
formatting to the output of Annotation Formats.

A field is delimited by the form #().

A class property is indicated by Class.Property. A drawing property is indicated by Drawing.Category.Property. A


project property is indicated by Project.Category.Property.

Examples of simple retrievable properties are:


#(CentrifugalPump.FlowRate) #(Project.General.Name) #(Drawing.General.Area)
The user may combine an expression with a property, for the purposes of formatting, autogeneration, and
assignment.

If the user wants to specify a format for a property, it must be included inside the field, specified with %.

For example, if the Flow Rate should always be shown as 3 numbers, then the field would be:
#(CengrifugalPump.FlowRate%NNN)
If the value needs to be autogenerated, the @ sign is used instead. #(PipeLine.LineNumber@NNN)

(The @NNN syntax immediately above was in support of an early concept for arbitrary autogeneration which was
based on a dumb counter. It is not surfaced in the UI, but will produce a value if created and assigned via APIs.)

To specify the lookup location for auto-generation source and increment value (as opposed to arbitrary
generation), a $ is added at the end of the @ portion of the field.
#(PipeLine.LineNumber@NNN$Project.LastLineNumber) If the autogenerated value should be assigned back, the ^
sign is added. #(PipeLine.LineNumber^@NNN$Project.LastLineNumber) If the user must input a value to be
assigned back, the autogenerate symbol is not used. #(PipeLine.LineNumber^NNN)

For variants where user input is expected, lack of input will be indicated by the mask symbol ‘?’.

Note that “simple” auto-generation as described in section III.D.1 is implemented directly in the code, and is not
represented by the Format String syntax in any way.

If the user wants to specify an optional field, the ~ symbol is used. For example, an optional field would be indicated
by: #(HotWaterPipe.Insulation~A*)

Optional fields are never auto-generated, but may be assigned back. Optional fields will not cause an error
condition if they cannot be assigned or retrieved. They will simply be skipped. Note that the optional syntax isn’t
surfaced in any UI.

Expressions can also be specified independent of retrievable properties. For example, to simply generate a
3-digit-minimum numeric value, the syntax would be:
#(@NNN)
Again, the syntax above was in support of the early counter-based arbitrary generation, which is not surfaced in the
UI.

AutoCAD P&ID Customization Page 103


To require user input of a 3-digit-minimum number, the syntax would be:
#(%NNN)
When being evaluated, any text that occurs between fields is passed through unchanged. This is referred to as “free
text.” Delimiters fall into this category.

If the user specified AREA-LINENUMBER, the format string would be:


#(Drawing.Category.Area)-#(Primary.LineNumber)
Note the “dash” delimiter between the fields.

As is standard in various programming languages, the backslash character can be used to ‘escape’ special characters
outside of the fields. If the user wants to use the # character as a delimiter, it should be escaped to prevent it from
being interpreted as the beginning of a field.

Note that the output of evaluating the format is a single text item, not multi-line text, so the newline character is
not valid.

To specify that the property should be retrieved from the target object’s mate (in the special case of CONNECTORS),
the property should be pre-pended by the equal sign.

For example, to retrieve the PnID number of the Off Page Connector in the other drawing from the target Off Page
Connector, the format string would be:
#(=Drawing.General.PNID)
Setting and retrieving the Format Strings of Tag Formats and Annotation Formats programmatically is done via the
AcPpTagFormat and AcPpAnnotation class APIs respectively.

B. APIs
The following header files will be of interest to developers wishing to work directly with Annotations and Tag
Formats.

The header file: AcPpAnnotation.h contains methods for creating P&ID Annotations, getting and setting annotation
properties (including accessing the Format Strings of specific attributes within the block reference), finding the
associated annotation style, etc.

The header file: AcPpAnnotationUtils.h contains methods for identifying whether a given text or block reference
entity is a P&ID Annotation, and for refreshing P&ID Annotations.

The header file: AcPpTagFormat.h contains methods for working with Tag Formats, getting and setting of Tag
Format properties (including getting and setting the Format String) and storing a Tag Format in the AcDbDatabase.

The header file AcPpTagUtils.h contains methods for validating that a Format String is properly formed, and for
evaluating a Format String against a target AcDbObjectId.

AutoCAD P&ID Customization Page 104


NOTE THAT the AcPpTagUtils namespace was unfortunately misnamed in the API. This should have been
AcPpFormatUtils. Do not let the API namespace confuse you into thinking that Format Strings are equivalent to
or only for use by the Tag feature.

DISCLAIMER:

Autodesk may make statements regarding planned or future development efforts for our existing or new products
and services. These statements are not intended to be a promise or guarantee of future delivery of products,
services or features but merely reflect our current plans, which may change. Purchasing decisions should not be
made based upon reliance on these statements.

Autodesk assumes no obligation to update these forward-looking statements to reflect events that occur or
circumstances that exist or change after the date on which they were made.

AutoCAD P&ID Customization Page 105

Potrebbero piacerti anche