⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moldbase._ls

📁 plc设计编程软件
💻 _LS
📖 第 1 页 / 共 5 页
字号:
    (action_tile "V1PT" "(gPoint 1)")
    (action_tile "V2PT" "(gPoint 2)")
    (action_tile "V3PT" "(gPoint 3)")
    (action_tile "V4PT" "(gPoint 4)")
    (action_tile "IfAuto" "(IniMoldPos)")
    (action_tile "gPtOnScr" "(setOnScr)")
    (action_tile "finish" "(GetAndDo) (done_dialog 1)")
    (action_tile "back43" "(done_dialog 3)")
    (setq MoldPosNext (start_dialog))
    (cond
      ((= 0 MoldPosNext) 
        (setq IfExitMoldSpec nil
    	      IfExitMoldType nil
    	      IfExitMoldSys nil
    	      IfExitMoldPos nil
        )
      )
      ((= 1 MoldPosNext)
        (if (and (= IfAuto "1") (= IfOnScr "1"))
          (progn
            (setq V1BasePt (getpoint "\nGet first view base point:"))
            (if V1BasePt 
              (progn
      	        (setq V2BasePt (polar V1BasePt 0 (+ tpX tpZ rpZ aPThk stZ bPThk spZ sbPThk bpZ 100))
	              V3BasePt (polar V2BasePt 0 (+ tpX 80))
	              V4BasePt (polar V1BasePt (* pi 1.5) (+ cpY tpZ rpZ aPThk stZ bPThk spZ sbPThk bpZ 80))
                )
      	      )
            )
          )
        )
        (if (and (= IfAuto "0") (= IfOnScr "1"))
          (progn
            (setq V1BasePt (getpoint "\nGet the first view base point:"))
            (if V1BasePt 
	      (setq V2BasePt (getpoint "\nGet the second view base point:"))
	      (setq V2BasePt nil)
            )
            (if V2BasePt 
	      (setq V3BasePt (getpoint "\nGet the third view base point:"))
	      (setq V3BasePt nil)
            )
            (if V3BasePt 
	      (setq V4BasePt (getpoint "\nGet the fourth view base point:"))
	      (setq V4BasePt nil)
            )
          )
        )
        (if (and V1BasePt V2BasePt V3BasePt V4BasePt)
          (progn
            (setq IfExitMoldSpec nil
    	          IfExitMoldType nil
    	          IfExitMoldSys nil
    	          IfExitMoldPos nil
            )
            (drawMoldBase)
          )
        )
      ) 
      ((= 2 MoldPosNext)
        (cond
          ((= 1 gpt)
            (setq V1BasePt (getpoint "\nPick a Point:"))
          )
          ((= 2 gpt)
            (setq V2BasePt (getpoint "\nPick a Point:"))
          )
          ((= 3 gpt)
            (setq V3BasePt (getpoint "\nPick a Point:"))
          )
          ((= 4 gpt)
            (setq V4BasePt (getpoint "\nPick a Point:"))
          )
        )
      )
      ((= 3 MoldPosNext)
        (setq IfExitMoldPos nil)
      )
    )
  )
)

(defun IniMoldPos()
  (setq IfAuto (get_tile "IfAuto"))
  (if V1BasePt
    (progn
      (set_tile "V1X" (rtos (car V1BasePt) 2 3))
      (set_tile "V1Y" (rtos (cadr V1BasePt) 2 3))
      (set_tile "V1Z" (rtos (caddr V1BasePt) 2 3))
    )
    (progn
      (setq V1BasePt '(0.0 0.0 0.0))
      (set_tile "V1X" "0.0")
      (set_tile "V1Y" "0.0")
      (set_tile "V1Z" "0.0")
    )
  )
  (if (= "0" IfOnScr)
    (if (= "1" IfAuto)
      (progn
        (setq V2BasePt (polar V1BasePt 0 (+ tpX tpZ rpZ aPThk stZ bPThk spZ sbPThk bpZ 100))
	      V3BasePt (polar V2BasePt 0 (+ tpX 80))
	      V4BasePt (polar V1BasePt (* pi 1.5) (+ cpY tpZ rpZ aPThk stZ bPThk spZ sbPThk bpZ 80))
        )
        (mode_tile "V2PT" 1)
        (mode_tile "V2X" 1)
        (mode_tile "V2Y" 1)
        (mode_tile "V2Z" 1)
        (mode_tile "V3PT" 1)
        (mode_tile "V3X" 1)
        (mode_tile "V3Y" 1)
        (mode_tile "V3Z" 1)
        (mode_tile "V4PT" 1)
        (mode_tile "V4X" 1)
        (mode_tile "V4Y" 1)
        (mode_tile "V4Z" 1)
      )
      (progn
        (mode_tile "V2PT" 0)
        (mode_tile "V2X" 0)
        (mode_tile "V2Y" 0)
        (mode_tile "V2Z" 0)
        (mode_tile "V3PT" 0)
        (mode_tile "V3X" 0)
        (mode_tile "V3Y" 0)
        (mode_tile "V3Z" 0)
        (mode_tile "V4PT" 0)
        (mode_tile "V4X" 0)
        (mode_tile "V4Y" 0)
        (mode_tile "V4Z" 0)
      )
    )
  )
  (if V2BasePt
    (progn
      (set_tile "V2X" (rtos (car V2BasePt) 2 3))
      (set_tile "V2Y" (rtos (cadr V2BasePt) 2 3))
      (set_tile "V2Z" (rtos (caddr V2BasePt) 2 3))
    )
    (progn
      (set_tile "V2X" "0.0")
      (set_tile "V2Y" "0.0")
      (set_tile "V2Z" "0.0")
    )
  )
  (if V3BasePt
    (progn
      (set_tile "V3X" (rtos (car V3BasePt) 2 3))
      (set_tile "V3Y" (rtos (cadr V3BasePt) 2 3))
      (set_tile "V3Z" (rtos (caddr V3BasePt) 2 3))
    )
    (progn
      (set_tile "V3X" "0.0")
      (set_tile "V3Y" "0.0")
      (set_tile "V3Z" "0.0")
    )
  )
  (if V4BasePt
    (progn
      (set_tile "V4X" (rtos (car V4BasePt) 2 3))
      (set_tile "V4Y" (rtos (cadr V4BasePt) 2 3))
      (set_tile "V4Z" (rtos (caddr V4BasePt) 2 3))
    )
    (progn
      (set_tile "V4X" "0.0")
      (set_tile "V4Y" "0.0")
      (set_tile "V4Z" "0.0")
    )
  )
  (if (= "0" IfOnScr)
    (if (and V1BasePt V2BasePt V3BasePt V4BasePt)
      (mode_tile "finish" 0)
      (mode_tile "finish" 1)
    )
  )
)

(defun setOnScr()
  (setq IfOnScr (get_tile "gPtOnScr"))
  (cond
    ((= "1" IfOnScr)
      (mode_tile "finish" 0)
      (if (= "1" IfAuto)
        (progn
	  (mode_tile "V1PT" 1)
	  (mode_tile "V1X" 1)
	  (mode_tile "V1Y" 1)
	  (mode_tile "V1Z" 1)
        )
        (progn
	  (mode_tile "V1PT" 1)
	  (mode_tile "V1X" 1)
	  (mode_tile "V1Z" 1)
	  (mode_tile "V1Y" 1)
          (mode_tile "V2PT" 1)
          (mode_tile "V2X" 1)
          (mode_tile "V2Y" 1)
          (mode_tile "V2Z" 1)
          (mode_tile "V3PT" 1)
          (mode_tile "V3X" 1)
          (mode_tile "V3Y" 1)
          (mode_tile "V3Z" 1)
          (mode_tile "V4PT" 1)
          (mode_tile "V4X" 1)
          (mode_tile "V4Y" 1)
          (mode_tile "V4Z" 1)
        )
      )
    )
    ((= "0" IfOnScr)
      (if (and V1BasePt V2BasePt V3BasePt V4BasePt)
        (mode_tile "finish" 0)
        (mode_tile "finish" 1)
      )
      (if (= "1" IfAuto)
        (progn
	  (mode_tile "V1PT" 0)
	  (mode_tile "V1X" 0)
	  (mode_tile "V1Y" 0)
	  (mode_tile "V1Z" 0)
        )
        (progn
	  (mode_tile "V1PT" 0)
	  (mode_tile "V1X" 0)
	  (mode_tile "V1Y" 0)
	  (mode_tile "V1Y" 0)
          (mode_tile "V2PT" 0)
          (mode_tile "V2X" 0)
          (mode_tile "V2Y" 0)
          (mode_tile "V2Z" 0)
          (mode_tile "V3PT" 0)
          (mode_tile "V3X" 0)
          (mode_tile "V3Y" 0)
          (mode_tile "V3Z" 0)
          (mode_tile "V4PT" 0)
          (mode_tile "V4X" 0)
          (mode_tile "V4Y" 0)
          (mode_tile "V4Z" 0)
        )
      )
    )
  )
)

(defun GetAndDo()
  (if (= IfAuto "0")
    (setq V1BasePt (list (atof (get_tile "V1X")) (atof (get_tile "V1Y")) (atof (get_tile "V1Z")))
          V2BasePt (list (atof (get_tile "V2X")) (atof (get_tile "V2Y")) (atof (get_tile "V2Z")))
	  V3BasePt (list (atof (get_tile "V3X")) (atof (get_tile "V3Y")) (atof (get_tile "V3Z")))
	  V4BasePt (list (atof (get_tile "V4X")) (atof (get_tile "V4Y")) (atof (get_tile "V4Z")))
    )
  )
)

(defun gPoint(ViewVar)
  (done_dialog 2)
  (cond 
    ((= 1 ViewVar)
      (setq gpt 1)
    )
    ((= 2 ViewVar)
      (setq gpt 2)
    )
    ((= 3 ViewVar)
      (setq gpt 3)
    )
    ((= 4 ViewVar)
      (setq gpt 4)
    )
  )
)
;********************************************************************************************************;

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;Main call function of Mold Base Creation
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(defun drawMoldBase(/ scrMLst	scrMMLst	scrDLst		scrDDLst	gpnDHLst	gpnHDLst
		gpnHD1Lst	gpnHDDLst	gpnHHLst	gpnCTLst	gpnCSLst	aP
		bP		sbP)

  (princ "\nPlease wait a moment...")
;---------------------------------------
;Register App
;---------------------------------------
  (regapp "V1X")
  (regapp "V1Y")
  (regapp "V2X")
  (regapp "V2Y")
  (regapp "V3X")
  (regapp "V3Y")
  (regapp "V4X")
  (regapp "V4Y")

  (setq scrMLst  '(M6   M8   M10   M12   M14   M16   M20)
	scrMMLst '("M6" "M8" "M10" "M12" "M14" "M16" "M20")
	scrDLst  '(6    8    10    12    14    16    20)
	scrDDLst '(10   13   16    18    21    24    30)
  )
  (if (= 'REAL (type aPThk))
    (setq aP (rtos aPThk 2 1))
    (setq aP (itoa aPThk))
  )
  (if (= 'REAL (type bPThk))
    (setq bP (rtos bPThk 2 1))
    (setq bP (itoa bPThk))
  )
  (if (= 'REAL (type sbPThk))
    (setq sbP (rtos sbPThk 2 1))
    (setq sbP (itoa sbPThk))
  )
  (cond
    ((= "SG" MoldSysNum)
      (setq gpnDHLst  '(6  6  8  8  8  10 12 15))
      (setq gpnHDLst  '(16 20 25 30 35 40 50 60))
      (setq gpnHD1Lst '(25 30 35 42 48 55 70 80))
      (setq gpnHDDLst '(30 35 40 47 54 61 76 86))
      (setq gpnHHLst  '(6  8  8  10 10 10 12 15))
    )
    ((= "TP" MoldSysNum)
      (setq gpnDHLst  '(8  10 12 14))
      (setq gpnHDLst  '(16 20 25 30))
      (setq gpnHD1Lst '(25 30 35 42))
      (setq gpnHDDLst '(30 35 40 47))
      (setq gpnHHLst  '(6  8  8  10))
    )
    ((= "PP" MoldSysNum)
      (setq spnDHLst  '(10 12 14 16 18))
      (setq spnHDLst  '(20 25 30 35 40))
      (setq spnHD1Lst '(30 35 42 42 55))
      (setq spnHDDLst '(35 40 47 54 61))
      (setq spnHHLst  '(8  8  10 10 10))
      (setq spnCDLst  '(26 31 38 43 48))
      (setq spnCSLst  '(18 21 24 24 24))
      (setq spnSSLst  '(10 12 14 14 14))
      (setq spnSHLst  '(12 14 16 16 16))

      (setq gpnDHLst  '(6  8  8  8  10))
      (setq gpnHDLst  '(20 25 30 35 40))
      (setq gpnHD1Lst '(30 35 42 48 55))
      (setq gpnHDDLst '(35 40 47 54 61))
      (setq gpnHHLst  '(8  8  10 10 10))
    )
  )
  (load "MoldCapC")
  (if V1BasePt
    (cond
      ((= "SG" MoldSysNum)
        (drawSGMoldView1)
      )
      ((= "TP" MoldSysNum)
        (drawTPMoldView1)
      )
      ((= "PP" MoldSysNum)
        (drawPPMoldView1)
      )
    )
  )
  (if V2BasePt
    (cond
      ((= "SG" MoldSysNum)
        (drawSGMoldView2)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -