dave
03-07-2006, 09:06 AM
Apparently in ver. 8.6 SP2 of the Autoplant P&ID software, there is a bug when you try and use the "attach specialty item or tie point command" (NewSPtieinconnection) The bug is that the specialty item or tie point will attach itself to the PIPE RUN PROCESS and not the PIPE RUN itself. I notified bentley and they have logged it. In the meantime, you have to run this lisp routine.
(defun c:RelinkSpecItmToPipeRun (/ en SelEnt keydata Tagtype conen ConnectEnt Condata LnkFld LnkRun keyVal RunVal)
(if (not MenuEnt)
(setq en (entsel (at_msg "\nSelect Specialty Item or Tie-in:" "PID_1484" 1 )))
(setq en (list MenuEnt ()))
)
(if (and
en
(setq SelEnt (get_link (car en)))
(setq keydata (at_asi_get_data SelEnt))
(setq Tagtype (cadr (assoc "^TAG_TYPE" keydata)))
(wcmatch Tagtype "AT_SPEC_ITEM*,AT_TIEIN*")
)
(progn
(if (and
(setq conen (entsel (at_msg "\nSelect component to connect to:" "PID_1485" 1 )))
(setq ConnectEnt (get_link (car conen)))
(setq Condata (at_asi_get_data ConnectEnt))
)
(progn
(if (= tagtype "AT_SPEC_ITEM")
(setq LnkFld "ASSOC_KEY" LnkRun "")
(setq LnkFld "LINE_ID" LnkRun "RUN_ID")
)
(if (wcmatch (cadr (assoc "^TAG_TYPE" Condata)) "AT_PROCESS,AT_PIPERUN")
(setq keyVal (cadr (assoc "KEYTAG" Condata))
RunVal (cadr (assoc "KEYTAG" Condata))
)
(setq keyVal (cadr (assoc "KEYTAG" Condata)))
)
(if (not keyVal) (setq keyVal ""))
(if (not RunVal) (setq RunVal ""))
(if (and (= tagtype "AT_TIEIN") (= RunVal ""))
(abort (at_msg "\nInvalid Selection, selection must be a Process line." "PID_1486" 1))
)
(at_asi_update_data SelEnt (list (list LnkFld keyVal)))
(if (/= RunVal "")
(at_asi_update_data SelEnt (list (list LnkRun RunVal)))
)
(prompt (at_msg "\nConnection Made." "PID_1487" 1))
)
(prompt (at_msg "\nInvalid Selection" "PID_1488" 1))
)
)
(prompt (at_msg "\nInvalid Selection, selecion must be a Specialty Item or Tie-in" "PID_1489" 1))
)
(ResetRightClickMenuVars)
(princ)
)
Copy that into a txt document and save it as "RelinkSpecItmToPipeRun.lsp"
then drag that file into your drawings, type "RelinkSpecItmToPipeRun", and re-attach your specialty items/ tie points to thier respective lines. FUN!
(defun c:RelinkSpecItmToPipeRun (/ en SelEnt keydata Tagtype conen ConnectEnt Condata LnkFld LnkRun keyVal RunVal)
(if (not MenuEnt)
(setq en (entsel (at_msg "\nSelect Specialty Item or Tie-in:" "PID_1484" 1 )))
(setq en (list MenuEnt ()))
)
(if (and
en
(setq SelEnt (get_link (car en)))
(setq keydata (at_asi_get_data SelEnt))
(setq Tagtype (cadr (assoc "^TAG_TYPE" keydata)))
(wcmatch Tagtype "AT_SPEC_ITEM*,AT_TIEIN*")
)
(progn
(if (and
(setq conen (entsel (at_msg "\nSelect component to connect to:" "PID_1485" 1 )))
(setq ConnectEnt (get_link (car conen)))
(setq Condata (at_asi_get_data ConnectEnt))
)
(progn
(if (= tagtype "AT_SPEC_ITEM")
(setq LnkFld "ASSOC_KEY" LnkRun "")
(setq LnkFld "LINE_ID" LnkRun "RUN_ID")
)
(if (wcmatch (cadr (assoc "^TAG_TYPE" Condata)) "AT_PROCESS,AT_PIPERUN")
(setq keyVal (cadr (assoc "KEYTAG" Condata))
RunVal (cadr (assoc "KEYTAG" Condata))
)
(setq keyVal (cadr (assoc "KEYTAG" Condata)))
)
(if (not keyVal) (setq keyVal ""))
(if (not RunVal) (setq RunVal ""))
(if (and (= tagtype "AT_TIEIN") (= RunVal ""))
(abort (at_msg "\nInvalid Selection, selection must be a Process line." "PID_1486" 1))
)
(at_asi_update_data SelEnt (list (list LnkFld keyVal)))
(if (/= RunVal "")
(at_asi_update_data SelEnt (list (list LnkRun RunVal)))
)
(prompt (at_msg "\nConnection Made." "PID_1487" 1))
)
(prompt (at_msg "\nInvalid Selection" "PID_1488" 1))
)
)
(prompt (at_msg "\nInvalid Selection, selecion must be a Specialty Item or Tie-in" "PID_1489" 1))
)
(ResetRightClickMenuVars)
(princ)
)
Copy that into a txt document and save it as "RelinkSpecItmToPipeRun.lsp"
then drag that file into your drawings, type "RelinkSpecItmToPipeRun", and re-attach your specialty items/ tie points to thier respective lines. FUN!