How to create a macro for this ???

 
  • Hi all,
    I just wanna ask about this :
    If I wanna change the ELBOW STYP from SR to LR
    Like this below:

    From
    =16397/2133 DTXR ELBOW 90DEG SR JIS B2312 BW

    To
    =16397/2133 DTXR      ELBOW 90DEG SR JIS B2312 BW

    How to do it ?

    Thank in advance
  • [QUOTE=pdms_user]Hi all,
    I just wanna ask about this :
    If I wanna change the ELBOW STYP from SR to LR
    Like this below:

    From
    =16397/2133 DTXR ELBOW 90DEG SR JIS B2312 BW

    To
    =16397/2133 DTXR      ELBOW 90DEG SR JIS B2312 BW

    How to do it ?

    Thank in advance


    Assuming that you are looking at changing this information in Design, it would seem that you would need a LR ELBO in the pipe spec to choose from.  The macro could then be something that changes the current SR ELBO spref to a LR ELBO spref.

    If you are looking at changing this information in Paragon / Specon, then you, or your Cat's & Spec's person, would have to modify the pipe spec so that the SR ELBO was replaced with an LR ELBO version.

    Hope this helps!!

    Have a Blessed Day!!
  • Hi proverbs3:6 !
    First of all I 'd like to say thank to you.
    Maybe your suggestion 's correct but I wanna explain more clearer.
    In Cat's & Spec's LR ELBO 's already included.
    I can change their type from SR to LR easily by choosing ELBO and use "choose all" command to change it.
    But it 's so slow and boring.
    That why I try to make a MAC for this stuff.
    Can I use MAC for this case ?

    Thanks
    :)
  •  

    $S-  -- Synonym translation OFF
    
    ONERROR GOLABEL /ERROR0
    
    !CurrentCE = !!CE
    
    --
    -- Collect all elbows that have SR somewhere in the name of the spre
    --
    var !Elbows collect all elbo with matchw(NAME OF SPRE, '*SR*') for $!!CE
    
    if !Elbows.size() gt 0 then
        --
        -- If there is at least one SR elbow found attempt to change it
        --
        do !Elbow values !Elbows
          --
          -- Go to ELBO in list and capture its SPRE name
          --
          $!Elbow
          !OldSpre = !!CE.SPRE.NAME
          --
          -- Take everything before SR in old spre name, then LR, then everything
          -- after SR and concatenate them together into new spre name.
          --
          !NewSpre = !OldSpre.before('SR') & 'LR' & !OldSpre.after('SR')
          --
          -- Attempt to change the SPRE name.  If the SPCO does not exist,
          -- error out.  If it does exist, report success.
          --
          SPRE $!NewSpre
          handle (2,109)
            $P --
            $P SPCO $!NewSpre does not exist!
            $P SPRE will not be changed for $!!CE.FULLNAME !
            $P --
          elsehandle NONE
            $P Changed SPRE for $!!CE.FULLNAME to $!NewSpre ...
          endhandle
        enddo
        $P
        $P Done!
        $P
        --
        -- Return use to initial CE
        --
        $!CurrentCE
      else
        --
        -- If there are no SR elbows found tell them so.
        --
        $P --
        $P There are no SR elbows under $!!CE.FULLNAME
        $P --
    endif
    
    --
    -- Switch synonyms back on if an error occurs.
    --
    LABEL /ERROR0
      handle ANY
        $!CurrentCE
        $S+
        RETURN ERROR
      endhandle
    
    $S+  -- Synonym translation ON
    

  • Try to sel using command syntax

    sel wi styp eq LR

    if this works, then make a synonym to do this

    $s LR = sel wi styp eq LR

    or create a new elbo and connect it

    $s NELR =  new elbo sel wi styp eq LR conn

    Happy Synonyming
  • Hi proverbs3:6 and PDMSGURU !
    Nice to hear from you.Anyway thank you so much for your suggestions.
    I 'd tried to use this command :
    sel wi styp eq LR
    but it didn't work.
    Now I read MAC file from proverbs3:6 and maybe I have to change some syntax or parameters for this MAC.
    Whenever it work I will tell you all about that and send you the MAC anyway.
    Please wishing for me :)
    Thank a lots!
  • Hi there,
    I tried to create a MAC but it 's seemly impossible.I want to change DTRX (like TYPE,STYP...) not SPRE (ATT of ELBO).
    Any one here know how to change them ?
    Thanks
  • Hello pdms_user,

    Without changing the SPREF of the elbow, or the attributes of the SPCO element, I am not sure how you can change the DTXR value.  Especially since the DTXR attribute is an attribute of a SPCO and not an ELBO.

    The changing of the SPREF of the elbow is occurring when you reselect the component, either through the forms or through PDMSGURU's synonym.  So I am not sure where to go from here.

    Hope you find what you are looking for.

    Have a Blessed Day!!
  • proverbs3:6
    thank for macro it very cool.
    yesterday I create a list for each diameter but from now on I know the trick of the cutting of string in the macro.
  • [QUOTE=pdms_user]Hi proverbs3:6 and PDMSGURU !
    Nice to hear from you.Anyway thank you so much for your suggestions.
    I 'd tried to use this command :
    sel wi styp eq LR
    but it didn't work.
    Now I read MAC file from proverbs3:6 and maybe I have to change some syntax or parameters for this MAC.
    Whenever it work I will tell you all about that and send you the MAC anyway.
    Please wishing for me :)
    Thank a lots!

    The command should be: SELECT WI STYP LR

    If you put STYP EQ LR then you'll get an error message.
    The same way you can also reselect the Lstube for every element required, by using the syntax like: SELECT LSTU WI STYP LR

    I normally make a list in PDMS with all components that need to be reselected, and write the above commands in the action field.

    /Thomas