Professional Documents
Culture Documents
PML Basics Part 1
PML Basics Part 1
To start out, I wanted to introduce the Dollar $ symbol and its meanings
$* = Comment line
$( = Starts a comment block
$) = Ends a comment block
Another neat trick that I like to use, especially when using the trace is
ALPHA REQ CLEAR (I will get more into this as I add more and more treads)
This command cleans your command line.
I really hope everyone gets involve and If i miss anything please added to the tread.
A query on usage in the field: how much do you use the $ comments (either $* or $(...$) )?
I want to be able to strip comments when publishing the PML, and am wondering just how
much trouble to go to with wierdly nested and hidden comments! (I will never mangle
anything, but might not strip all the comments if you do really odd things)
I use the $* comments as much as possible. Specially because I'm the kind of person who will
write a macro and forget about it and 6 months later someone is asking me to add some new
function to the macro. I try to add as much comments for my own personal benefit.
If you are new to pml and you want to make life easier. I suggest you try to comment as
much as possible. Also, name you macros something that will make since 6months to even
years from now. I have spend hours, days even months writing macros only to misplace them.
By adding as much comments, you are not only making your life easier but your employeer as
well. This go back to the ISEIT meeting.
I reckon better add the ALPHA LOG command...where you can take ur logs to a file and not
flood ur command line :)
---------------------------------------------------------------------------------------------------------------------
Yes I agree.
When using the Tracking, you might want to use the alpha log command first. Try this.
Turn trace on
$R6
The modify name form will come up and your command line filled with text.
$R
To turn off the Trace
Open the .txt file and check out some of the code. That is how I learn pml, by reading aveva's
code.
Just a note: You are only allowed to have one log file open at the time. Another option will be
to use Alpha Files. I'll get to that later.
$R<n>
Can also do $HR at the command line to get all options for $R
---------------------------------------------------------------------------------------------------------------------
Quote:
Originally Posted by TimSharrock
A query on usage in the field: how much do you use the $ comments (either $* or $(...$) )?
I want to be able to strip comments when publishing the PML, and am wondering just how
much trouble to go to with wierdly nested and hidden comments! (I will never mangle
anything, but might not strip all the comments if you do really odd things)
Hello Tim,
I use $( and $) for large blocks of comments or for quick trouble shooting. But for individual
lines of code / comments, I will normally use -- because I do not need to hold down the SHIFT
key to get the -- to appear (quicker commenting for single lines).
From your personal opinion, is there a preference between $* and -- ? Does one single-line
commenting method work better than the other? Just curious ...
If I do not remember wrong, you cannot use -- for inline comments where you can use the $*
syntax.
like:
handle any $* Taking care of a problem. If I remember correctly you cannot do this with --
endhandle
I recall reading somewhere that -- can only be used for commenting whole lines.
=====================================================================
Quote:
Originally Posted by TBack
If I do not remember wrong, you cannot use -- for inline comments where you can use the $*
syntax.
Quote:
Originally Posted by proverbs3:6
From your personal opinion, is there a preference between $* and -- ? Does one single-line
commenting method work better than the other? Just curious ...
This is the macro I am using to test comments so far - I have lots more odd things to add!
Code:
I didn't know I could comment out part of a line with the $*. !!
awesome!!!
(#17)
Hi gentlemen,
I am used to run a macro loaded with my favourite synonyms when I start PDMS. So I tried to
use the command $QS as I saw it in the first post. Now I see in command window the list and
I would like to get clear something.
There are synonyms with $S1 before the synonym description. Example :
Then I have here synonyms with $S0 (all my syns + some more). Example :
$S0 FGF =new fla choo all new gask choo all new fla choo all (short sequence for inserting pair
of flanges)
And then finally there are some synonyms with $SU1 for running a macro. Example :
$SU1 CALLE =$M/%PDMSUI%/DES/EQUI/$S1
I don't understand the difference between $S0, $S1, $SU1. Is it supposed to be an argument?
Are not arguments in general $n - without 'S'? What does it actually do? And why it says :
When I try to run the macro for myself (in this case : $M/%PDMSUI%/DES/EQUI/$S1 )?
One question...
"$*" works any position in the line, and "--" works only at the beggining of the line.
What is an Array?
The simple answer to me would be a collection.
Type 2
!Array.Append('BOB')
!Array.Append('GEORGE')
!Array.Append('KELLY')
q var !Array
!Array.Clear()
!Array.Size()
!Array.Sort()
!Array.SortUnique()
!Array.Unique()
You can find out more in the PDMS Manual, Search Array Objects.
wats the difference between type1 and type2......sorry am just starting to learn PML..so
forgive me if im asking sumthing verryy basic!
1. How can we assign values to elements using PML...e.g. If I have to assign pspec /A300 TO
ALL PIPES WITH BORE SIZE 100
2. How do we collect elements and run a macro on them...e.g. collect ALL brances under
zone /10LAB and set/change Ispec to /HC
and so on.....
What is the difference between type1 and type2. Now, they are not called type1 and 2, I just
added that so everyone can see that you can do more that one way. An array is a collection
when you use the [ ] and specify a number, you are telling the exact order you want that item
to be in.
For example:
!Array[1] = !!CE
I am adding my current element to the first member of the array
Now, you added 2 questions. I believe that cvitte71 has a hot tread about collections.
In order to do what you are asking for we are going to need to use a loop. I'm going to be
posting another PML Basics (Loop) and I'll use your questions as examples.
Here we go again. Out of everything that I have learn about pml, I had the most difficulty
learning Loops. I didn't understand them, finally after many mistakes I got a handle on loops.
What is a loop?
It’s a series of commands that will continue to happen until the loop is broken.
Do
This starts a loop, now one of my first mistakes was that I didn't specify the number of times I
wanted the loop to run and I didn't know how to break the command
Enddo
For every "Do" you must have an "Enddo"
Now I know I haven't covered collections but you can check out a nice sticky threat cvitte71
has started. So let’s do a simple macro. This macro will collect all sections, check the gtype to
make sure its correct and print any sections that have the incorrect gtype.
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
I know this is not PML2; lets get the basics out first.
Do !x from 1 to !Coll.Size()
Now, what does this line mean? I already explained that the "Do" starts the loop.
The second parts "!x", is a number any number. In this case from 1 to !Coll.size().
In other words, the first time the loop runs, !x will equal 1 then 2 so on until it reaches !
Coll.Size()
What is !coll.size()?
It’s the number of items inside the !coll array.
Enddo
$**********************************************
with out the comments
$**********************************************
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
Do !x from 1 to !Coll.Size()
$P $!Coll[$!x] has the wrong Gtype
Enddo
Hello,
you can also use:
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
Do !x indices !Coll
$P $!Coll[$!x] has the wrong Gtype
Enddo
or
Do !x values !Coll
$P $!x has the wrong Gtype
Enddo
Do !x indices !Coll
!X is still a number
Do !x values !Coll
!x is now the item or an element
1. How can we assign values to elements using PML...e.g. If you have to assign pspec /A300
TO ALL PIPE WITH BORE SIZE 100
First, You have to do a collection for all Pipe with bore eq 100. Again, cvitte71 has a great
thread on collections going on.
Var !PIPE COLL ALL (PIPE) WITH (PARAM[1] OF CATREF OF SPCO EQ 100) FOR $!!CE
Do !x indices !PIPE
$!PIPE[$!x]
PSPEC /A300
Handle Any $* Why did I add a Handle, the pipe could of been claim or locked, this
way the macro will continue
$pError on $!PIPE[$!x] $*Printing the error so I can identify the element that the
pspec was not assigned
EndHandle
Enddo
2. How do we collect elements and run a macro on them...e.g. collect ALL brances under
zone /10LAB and set/change Ispec to /HC
Do !y indices !BRANCH
$!BRANCH[$!y]
Ispec /HC
Handle any
$pError on $!BRANCH[$!y]
EndHandle
Enddo
Are you going to examine OBJECTS, especially the COLLECTION OBJECT. And the use of this
object? Like you pointed out in your thread, the other collections thread explores multiple
ways to create the collection using both PML1 and PML2. Very intriquing. The multiplicities of
options in using PML can be daunting.
--------------------------------------------------------------------------------------------------
Yes, I'll start getting more into object collect & object collections. Here is another example
using a different type of collection
Do !y indices !BRANCH
$!BRANCH[$!y]
Ispec /HC
Handle any
$pError on $!BRANCH[$!y]
EndHandle
Enddo
PDMSGuru, I'm not a piping designer (my back ground is structural) and I got the
information on how to queary the pipe bore from a previous threat you answered, could you
double check my previous collection. I don't want to give anyone the wrong information.
Specially since we are not running pdms out of the box, we have customize pdms to an
extreme.
================================================================
As you get an array of element references directly by using the CollectAllFor function you
could also assign the attribute value without first jumping to the element, like:
Do !y indices !BRANCH
!BRANCH[!y].Ispec = /HC
Handle any
$p Error on $!BRANCH[$!y]
EndHandle
Enddo
The selected element would in this example remain the same also while running through the
loop.
jcont20,
Var !PIPE COLL ALL (PIPE) WITH (PARAM[1] OF CATREF OF SPCO EQ 100) FOR $!!CE
PIPE Elements do not have CATREF's, in addition, the BORE ATT on a PIPE element is not even
an intelligent one.
Var !PIPE COLL ALL BRAN MEM WITH (p1 bor EQ 100) FOR CE
Collecting Branch members themselves is the best way I find to work with piping components.
Heads and tails may change on branches, and sometimes they don't even reflect what's in the
pipe, a head bore may be 100, then the first mem is a reducer, the rest of the branch might
then be 150. so working with branch members is better in my humble opinion.
Next, notice I asked for the p1 bore, this guarantees me that I will add an element with at
least one side of it matching my criteria, I could add more criteria to guarantee that I get
anything that has 100 as a bore, p1, p2 , p3 etc. But by asking for catalogue parameters, I'm
assuming that my catalogue administrator hasn't done anything silly with the first parameter.
An event that has undone me in the past.
Also, to clean it up a bit, you don't need the $!!CE, just CE will do.
Tip: on anything that has a SPRE with a CATREF, the CATREF is also available for query from
that element. So instead of CATREF of SPRE, (I would not say SPCO, as that is an element,
and not a reference), you could just call the CATREF, it is a pseudo attribute.
I've heard some really good things about you jcont20, someone that spoke with you at the
Americas Conference in the US says you are doing some great things with Ring Plates. Your
company is lucky to have you, and so is PDMSWORLD. Keep up these great posts. I'll
comment when you invite me to. I really enjoy reading them.
Hi JCont20,
Thank u 4 explaining things much better than the manuals :)....i did try ur and others code
and its a good practice as a start...for one of our real projects i have to rename ALL zones with
name contaioning -PREM to -PRELIM
please review my code below and guide me how to rename the zones as required above...i
belive my collection is ok..but only the rename part i need to fix with ur help
Do !y indices !PRZONE
$!PRZONE[$!y]
RENAME ....HOW?????
Handle any
$pError on $!przone[$!y]
EndHandle
Enddo
endfunction
I'm not in front of PDMS at present (can't afford the software at home)... So I can't check
this... Check this in a limited area before running.....
var !PRZone coll all Zone with (Match (Name of Zone, 'PREM') gt 0) for ce $* I like Match
instead of Matchwild
EndFunction
Quote:
Originally Posted by 786PDMS
Do !y indices !PRZONE
!PRZONE[!y].Dbref().Name = !PRZONE[!y].Dbref().Name.Replace('-PREM','-PRELIM')
Handle any
$p Error on $!przone[$!y]
EndHandle
Enddo
@Tback
tried ur code and it works beautiful!!.....
@ccotton
i'll also try urs and see how it goes....just wondering wats the diff b/w
Quote:
Originally Posted by 786PDMS
$* !Coll is an array
Do !x values !coll
$!X $* in this case, X is a reference number
Do !x indice !coll
$!X $* in this case, X is a number (1,2,3, you get the point)
Hope this help, sorry it took me so long, I have been out of the country and extreamly
busy...But I guess everyone is busy now and days...
Hi I'm new in the forum and I hope somebody can help me because I want to make an array
checker, that compare every element of the array and delete the elements repeated from the
array.
HELLO,
there is especial commands for work with arrays in the PDMS manuals.
you can use "UNIQUE" for delete the duplicate values.
more info: PDMS Software Customisation Guide 6-9 Version 11.6SP1
bye.
Hi JCont20
The GTYPE macro is brilliant...one of my colleuges was just talking about that discrepancy the
other day...
SURE, YOU CAN FIX IT. I HAVE A SCHEDULE TASK THAT TAKES CARE OF IT FOR THE USER.
WORKS SOMETHING LIKE THIS.
Code:
Do !x INDICE !SCTN
IF !SCTN[$!x].CATREF.UNSET() Then
$P$!SCTN[$!X].NAME is unset
skip
EndIf
!SCTN[$!x].GTYPE = !SCTN[$!x].CATREF.GTYPE
HANDLE ANY
$PError with sctn $!SCTN[$!x].Name
ENDHANDLE
ENDDO
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
Do !x from 1 to !Coll.Size()
$P $!Coll[$!x] has the wrong Gtype
Enddo
!Coll is array of sections's and gensecs's names whose gtype not equal gtype of catref. It is
collection from current element ($!!CE).
Coll - you are right, this is command to make collection and to store it in array !Coll.
$!!CE gives reference number of CE.
$P $!Coll[$!x] - in [] number of array's element is indicates, in this case $!x is number of
current cycle of the loop.
Alright, Sorry I have been gone for so long, I have been extremely busy like everyone else in
the PDMS community.
Code:
Define Function !!MultiCopy()
!element = !!ce
Do
New $!Element.Type copy prev On ID @
Handle Any
refresh
return
EndHandle
Enddo
EndFunction
Hello!
Im a newbie and Im trying to make a loop that collects the names of all sheets in a specific
regi and writes them to a logfile. Can anybody tell me what im doing wrong?
/PIPELAYOUT/
enddo
!File.writefile('overwrite',!Array)
Thanks for the quick response. But it didnt work. Quite confusing with all the $ !. This is my
code at the moment
ONERROR CONTINUE
/PIPELAYOUT/
thanks
I thank for all this kind of posts, because i'm getting startiing in PML and it's very usefull to
get this info...
Quote:
/PIPELAYOUT/
unless I am very much mistaken (and I could be) as you havent navigated to the sheet name
the var 1 name will always be the same.
Personally I would do it this way (its a bit more PML2 like as well)
Enddo
that way you dont navigate (as you dont need to)
!File.writefile('overwrite',!Array)
Matt
u are not misstaking. Ive added another row to the code $!SHEENAME[$!i].
I must say your solution looks better but mine works.
Thanks anyway
hELLO EVERYONE
I'm Having trouble with a usefull macro (for me) wich is intended to change an
attribute to all the elements for (inside) the ce. The arguments of this macro are:
the idea is, if i need to change the section's justification line inside the ce (a framework) i
write:
Quote:
$* PRETENDE HACER UNA MACRO QUE CAMBIE UN ATRIBUTO A TODOS LOS ELEMENTOS
$* $1 DEL CURRENT ELEMENT.
$*
$* $1 = TIPO DE ELEMENTOS EN LOS QUE APLICA LA MACRO
$* $2 = ATRIBUTO
$* $3 = VALOR DEL ATRIBUTO FINAL
$*
$*
$!COLECCION[$!Y]
$* CONTROL DE ERRORES,
$*---------------------------------------------
$* CONTROL ERROR
HANDLE ANY
ENDHANDLE
ENDDO
i HAVE TRIED WITH THE ALTERNATIVES THAT YOU SHOW HERE LIKE
Quote:
$* PRETENDE HACER UNA MACRO QUE CAMBIE UN ATRIBUTO A TODOS LOS ELEMENTOS
$* $1 DEL CURRENT ELEMENT.
$*
$* $1 = TIPO DE ELEMENTOS EN LOS QUE APLICA LA MACRO
$* $2 = ATRIBUTO
$* $3 = VALOR DEL ATRIBUTO FINAL
$*
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
$* CONTROL DE ERRORES,
HANDLE ANY
ENDHANDLE
ENDDO
BUT IT DIDN'T WORK... I THINK THAT IS BECAUSE THE CE IS A FRMW AND THE SENTENCE "!
COLECCION[!Y].$2 = $3" TRY TO CHANGE THE ATTRIBUTE TO THE FRMW INSTEAD OF THE
SCTN (I HAVE PROVED WITH "!COLECCION[!Y].JUSL = TOS" TOO)... am I right?
Christiansen,
try this....
Code:
!ATTRIBUTE = $2
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
i've tried with your code but it returns an error (i.e. if i try to change all the sections in a
framework, i have to be in the framework, so, the program return line 1 !ATTRIBUTE = $2 and
a message: "a framework does not have attribute jusl")
thanks
Code:
!ATTRIBUTE = '$2'
it works...
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
one consideration is to specify the third argument ($3) as string when it's necesary, por
example
If you want to change all the JUSL of the sections in a framework you type:
where:
and the new spref value without the ' ', because it's not a string
I forgot ..
(i explain this because someone could need it and don't know what i'm talking about)
Code:
!ATTRIBUTE = '$2'
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE (2,794)
!COLECCION[!Y].$!ATTRIBUTE = '$3'
ELSEHANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
hello guys
i need to rename all branches for given pipe
Code:
Thx Jcont220
It Helps Me A Lot
& simultaneously set attributes :lsize duty :lproc :lsno Pspec Ispec Tspec :Areacode :lsuf :Isoref
:Mtoref :Mtodrwg :Mtoarea
As per project philosophy
Procedure:
Go to respective zone click ‘new pipe’ button then feed the value & then apply
If insulation or tracing spec if not defined in line number don’t leave blank put ‘unset’
& if insulation or tracing spec is defined put spec name following forward slash ‘/’
For e.g.
OUTPUT OF THE MACRO
PML Basics Part 4 (Expressions and IF statements)
Well, I have coved Arrays and Loops. Now I want to start getting in to expressions and If
statements.
Before we get started writing our own expressions. I remember when I was first learning
expressions, I turn to the manuals. If you have a chance, please check it out. But, since I
know most people don't really open the manual, I'm going to post the part on expressions.
1. Brackets ()
2. */
3. +-
4. EQ, NEQ, LT, LE, GE, GT
5. NOT
6. AND
7. OR
Now, when writing an expression, think back to high school math or even middle school
math when you learn how to solve nested expressions.
(4 * (POWER(PARA[1], 2) + POWER(PARA[2] , 2) )
Logical expressions
PDMS attributes
Logical constants
TRUE, ON, YES for true
FALSE, OFF, NO for false
Logical Operators
Conparator operators (EQ, NEQ, LT, GT, LEQ, GEQ)
Boolean operators (NOT, AND, OR)
Logical functions
BADREF
DEFINED, UNDEFINED
CREATE
DELETED
EMPTY
MATCHWILD
MODIFIED
UNSET
VLOGICAL
Logical array expressions
PDMS attributes
Ex: XLEN YLEN POHE POSITION ORIENTATION
Numeric operator
+ Add
- Subtract
* Multiply
/ Divide
Numeric function
I'm not going to list all of them but some of them are:
ABS, ACOS, ASIN, ATAN, SIN, COS, TAN, MATCH, MAX, SQRT..
Real expressions
See numeric funtions
Text expressions
A text string
PDMS attributes
Text operators
Text fuctions
__________________________________________________ _________________
Ok, lets start creating some If statements using some of this expressions. This is an
example I like to use a lot.
When users descover that they can create sctns using syntax, sometimes they forget to
change all the attributes. One of those attributes will be the GTYPE. So a simple expression
will be:
or
Its, getting late and my wife is ready to use the computer. If anyone has any
request or question, please ask. I'll continue this tomorrow.
I tend not to use the !!ce as you have to navigate to it within PDMS, I find it safer to create
say an array of items (which will be dbrefs) then query or assign accordingly e.g.
$* see if we found any data errors, if so output to a file and advise user
If (!Array.size() gt 0)thne
$P we have an out put error/log file
!File.writefile('overwrite',!Array)
Else
$P it all went well
Endif
Hello,
I'm a new PDMS/PML user, I'm just learning.
Can anybody help me in macro writing?
I would like to make a macro in PML1, which is counts the valves and elbows in a current site
and write the result in a file.
I try to make it since two days, but it isn't works.
Please help me, if you can ...
!Valve = !!collectallfor('valv','',!!ce) --- !!ce ==> ce, in this case the site you want to collect
valves from
!Elbow = !!collectallfor('elbo','',!!ce) --- !!ce ==> ce, in this case the site you want to collect
elbows from
!ValveSize = !Valve.size()
!ElbowSize = .......
If you want to do it for a number of sites then collect the sites into an array
e.g. !Sites = !!collectallfor('site','',world)
Do !A indices !Sites
$!Sites[$!A]
<the do the collection above>
<write to the file - !File.writefile('append',!Items)
Enddo
Quote:
(I can do it with report facilities, but I'd like to learn the PML programming)
Thanks again!
Lóri
Seems fair. In the !File.writefile() part you have the option to either 'overwrite' or 'append'. If
I was using a DO loop I would delete the file first (!File.deletefile() ) before I started the DO
loop, that way you know you are starting with a cleab file.
In the !!Collectallfor(...) funcntion, you have three options, the first is a String and you supply
what you are looking for, teh second is a conditional string i.e. if you only want the first string
to match an attribute, the third is a dbref, so !!ce or world work (or any other dbref variable)
If I wanted elbows from sites that were piping site I would set all my FUNC attrributes on the
Piping sites to PIP and then collect in this way
!Els = !!collectallfor('elbo','Func of site eq |PIP|',World)
Matt
If you are familier with "VAR !VARNAME COLLECT ~~~" and "VAR !VARNAME EVALUATE~~~",
and some sort operation, I don't see any benefit to use those objects/functions.
Sorry to say that I'm happy with PML2 and don't really see to much of this processing time. I
do some heavy collections and I really don't see a big proccess time, not at lease something to
complain about. If I use pml collecting var !coll coll, the collection is a string and I really
don't want to be converting or adding extra lines to convert it into a dbref(), the smaller the
macro, the easier to understand. That's the way I see it.
I agree,
var !coll collect all ( ELBO ) for CE (or name of element research),
and next:
var !collname eval name for all from !coll
(for evaluate name of all of previous list)
Why not
!C = object collection()
!C.scope(!!ce)
!C.filter( object EXPRESSION( 'true' )
!C.type('ELBO')
!Names = object ARRAY()
!Dbrefs = !C.results()
do !Dbref values !Dbrefs
!Names.append(!Dbref.flnm)
enddo
I agree that PML2 style is good for peoples who already familier with the other programming
language, and I know that it is mandatory to know PML2 with PDMS 12 .net programming.
Everybody should know that if the PDMS user is waiting for 10 sec. macro processing time, he
will do nothing, just wait for the operation is done.
You'll see what will happen if this operation is iterrated many times , done by many peoples,
every day.
Anyway, now we have PDMS 12... We can use Visual Studio for customization. Many of
problems will be disappeard.
Hope to see the world we don't need "variable" command anymore.
I tired to explain both PML1 and PML2 commands in my training course...
11-14-2007
I will try to put small tip of PML at here, instead of complaining about things.
Here is an example of basic report with DB element collection.
With my experience, the following PML1/PML2 combination is fastest way for coding to
collect DB elements and attributes, especially for some quick data fix and data listing. Often
GUI report is not enogh to produce required information.
(the difficult bit is not in this example. Give me time.)
11-14-2007
Back to basic;
Useful function
set(!variable)
----returns if the variable has non "unset" value.
unset(!variable)
----returns opposite value to set().
!variable.set()
!variable.unset()
The "defined" value is the same status just after you declare a variable.
PDMS variable has intermidiate condition before you load concreate value to the variable. This
status will be called as "defined".
Once the variable is defined, you can check the variable has cocreate value (not an unset
value" by using set()/unset().
try the following examle to see the result.
----Start----------------------------
!result = defined(!variable)
$P Not yet defined-result of defined = $!result
!result = undefined(!variable)
$P Not yet defined-result of undefined = $!result
!result = set(!variable)
$P Defined but has no value -result of set = $!result
!result = unset(!variable)
$P Defined but has no value -result of set = $!result
!variable = |ABC|
!result = set(!variable)
$P Defined and has value -result of set = $!result
!result = unset(!variable)
$P Defined and has value -result of unset = $!result
Please try to copy the attribute value to your variable, and use the function/method above.
I recommend you to use "!variable = [attribute name]" command to get what type of object
will be loaded to your variable. if we use "var !variable [attribute name]" command, we always
get string value, and this will be the same value as we see by "Q [attribute name]" ([attribute
name] can be "POSITION", "ORIENTATION", "FUNCTION", etc.
Please be noted that the "empty" text string and "unset" value is different.
"empty" text string will be recognized as "set" value.