Pipe name callout in ADA

Hi everyone,

 

I have an pml function for outputting pipe dimensions in my ADA, but I noticed it wasn’t outputting pipes with fractions (1/2” and ¾”), below is what I have,

!Pname = !brn.dbref().namn.before('/')                 

                                 !checkh =  !!checkposwithinview(!brn.dbref().hpos ,!view)

                                   !cpart = !checkh.split()

             if !cpart[1].match('true').gt(0) then

                                                 !opt[1] = !cpart[2].substring(1,1)

                                                 !opt[2] = !cpart[2].substring(2,1)

                                               !!ce = !dim$!opt[1]

                NEW DPPT on PH of $!brn PLTX |$!Pname| plstyle $!plstval

                                               !!ce = !dim$!opt[2]

                NEW DPPT on PH of $!brn PLTX |$!Pname| plstyle $!plstval

             endif

 

                                 !checkt =  !!checkposwithinview(!brn.dbref().tpos ,!view)

                                   !cpart = !checkt.split()

             if !cpart[1].match('true').gt(0) then

                                                 !opt[1] = !cpart[2].substring(1,1)

                                                 !opt[2] = !cpart[2].substring(2,1)

                                               !!ce = !dim$!opt[1]

                NEW DPPT on PT of $!brn PLTX |$!Pname| plstyle $!plstval

                                               !!ce = !dim$!opt[2]

                NEW DPPT on PT of $!brn PLTX |$!Pname| plstyle $!plstval

             Endif

 

And output looks like this below, it wasn’t outputting the ½ and ¾” pipes as it should:

So, I re-wrote the code to see the second “/”, see below

!part1 = !brn.dbref().namn.before('/')

                              !rest = !brn.dbref().namn.after('/')

                              !part2 = !rest.before('/')

                              !Pname = !part1 + '/' + !part2

                                 !checkh =  !!checkposwithinview(!brn.dbref().hpos ,!view)

                                   !cpart = !checkh.split()

             if !cpart[1].match('true').gt(0) then

                                                 !opt[1] = !cpart[2].substring(1,1)

                                                 !opt[2] = !cpart[2].substring(2,1)

                                               !!ce = !dim$!opt[1]

                NEW DPPT on PH of $!brn PLTX |$!Pname| plstyle $!plstval

                                               !!ce = !dim$!opt[2]

                NEW DPPT on PH of $!brn PLTX |$!Pname| plstyle $!plstval

             endif

 

                                 !checkt =  !!checkposwithinview(!brn.dbref().tpos ,!view)

                                   !cpart = !checkt.split()

             if !cpart[1].match('true').gt(0) then

                                                 !opt[1] = !cpart[2].substring(1,1)

                                                 !opt[2] = !cpart[2].substring(2,1)

                                               !!ce = !dim$!opt[1]

                NEW DPPT on PT of $!brn PLTX |$!Pname| plstyle $!plstval

                                               !!ce = !dim$!opt[2]

                NEW DPPT on PT of $!brn PLTX |$!Pname| plstyle $!plstval

             Endif

 

 

Below is the output, which works well for fraction lines (1/2” & ¾”) but now outputs the branch name for all other line

 

How do I re-write the PML to output well both fraction lines and whole number lines? Below is presently what I have.