Ã÷¾­CADÉçÇø

 ÕÒ»ØÃÜÂë
 ×¢²á

QQ怬

Ö»ÐèÒ»²½£¬¿ìËÙ¿ªÊ¼

ËÑË÷
²é¿´: 7567|»Ø¸´: 22

[º¯Êý] [Ô´Âë]ÕýÔò±í´ïʽº¯Êý

    [¸´ÖÆÁ´½Ó]
·¢±íÓÚ 2015-10-14 16:45:07 | ÏÔʾȫ²¿Â¥²ã |ÔĶÁģʽ
²»ÖªµÀÂÛ̳ËÑË÷¹¦ÄܽÏÈõ»¹ÊÇÔõô£¬ÕÒ²»µ½Ò»ÌõÕýÔò±í´ïʽµÄº¯Êý£¬²»¹ý»¹ÊÇ·¢ÏÖÁËЩ×ÊÁÏ£¬ÕûÀíдÁËÁ½¸öº¯Êý¹©ÓÐÐèÒªÖ®È˵÷Óá£ÓÉÓÚдµÃ±È½Ï×¾£¬Íû´óÉñÃÇÖ¸µã¡£
×¢£ºÊ¹Óøú¯ÊýÐèÒªÓÐÕýÔò±í´ïʽµÄ»ù´¡£¬Àý×ÓΪ¶Á³ö×Ö·û´®ÖÐËùÓеÄÊýÖµ£¬¼´£¨¡°13049.66¡±¡°19.574¡±£©

ÕýÔòʹÓý̳Ìhttp://bbs.mjtd.com/thread-182083-1-1.html
  1. (setq str "S=13049.66 ƽ·½Ã× ºÏ19.574Ķ")
  2. (try-StrRegExp str "[\\d.]+")
  3. (try-StrRegExpReplace str "[\\d.]+" "Ìæ»»µô")

  4. ;Æ¥ÅäÕýÔò±í´ïʽ
  5. ;;1¡¢×Ö·û´® 2¡¢±í´ïʽ
  6. ;;(setq str "S=13049.66 ƽ·½Ã× ºÏ19.574Ķ")
  7. ;;(try-StrRegExp str "[\\d.]+")
  8. (defun try-StrRegExp(str1 expr)
  9.   (_Replace str1 expr nil "")
  10. )
  11. ;ÕýÔò±í´ïʽ×Ö·ûÌæ»».
  12. ;;1¡¢×Ö·û´® 2¡¢±í´ïʽ 3¡¢Ìæ»»
  13. ;;×¢£º±¾º¯ÊýΪƥÅä¶àÐС¢ºöÂÔ´óСд
  14. ;;(setq str "S=13049.66 ƽ·½Ã× ºÏ19.574Ķ")
  15. ;;(try-StrRegExpReplace str "[\\d.]+" "Ìæ»»µô")
  16. (defun try-StrRegExpReplace(str1 expr str2)
  17.   (_Replace str1 expr T str2)
  18. )

  19. (defun _Replace(str1 str2 bull str3 / lst matchcollect reg)
  20.   (setq lst '())
  21.   (setq reg (vlax-create-object "vbscript.regexp")) ;´´½¨ÕýÔò±í´ïʽ
  22.   
  23.   (vlax-put-property reg 'global -1) ;ÊÇ·ñÆ¥ÅäÈ«²¿ £¨-1ÊÇ £¬0 ²»ÊÇ£©
  24.   (vlax-put-property reg 'Multiline -1);ÊÇ·ñ¶àÐÐÆ¥Åä £¨-1ÊÇ £¬0 ²»ÊÇ£©
  25.   (vlax-put-property reg 'IgnoreCase -1);ÊÇ·ñºöÂÔ´óСд £¨-1ÊÇ £¬0 ²»ÊÇ£©
  26.   (vlax-put-property reg 'pattern str2);lisp \\
  27.   ;;;   1.(vlax-invoke-method reg 'test str)ÅжÏ×Ö·û´®ÊÇ·ñÓëÕýÔò±í´ïʽƥÅä
  28.   (if (vlax-invoke-method reg 'test str1)
  29.     ;;;   2.(vlax-invoke-method reg 'Execute str)Éú³ÉÆ¥Å伯ºÏ   
  30.     (progn (setq matchcollect (vlax-invoke-method reg 'Execute str1))
  31.       ;;;   3.´òÓ¡Æ¥ÅäµÄÿ¸ö¼¯ºÏÔªËصÄvalue   
  32.       (vlax-for match_item matchcollect (setq lst(cons(eval (vlax-get-property match_item 'value))lst)))
  33.     )
  34.   )
  35.   ;;;   4.Ì滻ƥÅäµÄÖµ  (vlax-invoke-method reg 'Replace str "replace")  Éú³Éstr¸±±¾   
  36.   (setq lst(reverse lst))
  37.   (if bull
  38.   (setq lst(vlax-invoke-method reg 'Replace str1 str3)))
  39.   ;;;  ----------------- end ÕýÔò±í´ïʽ·½·¨
  40.   (vlax-release-object reg);ÊÍ·ÅÄÚ´æ
  41.   lst
  42. )


ÆÀ·Ö

²ÎÓëÈËÊý 6Ã÷¾­±Ò +6 ÊÕÆð ÀíÓÉ
hubeiwdlue + 1 ºÜ¸øÁ¦!
tigcat + 1 ºÜ¸øÁ¦!
qiuhai1991 + 1
crazylsp + 1 ÔÞÒ»¸ö!
±ùÖ®¾øÁµ + 1 ÔÞÒ»¸ö!
jltx123456 + 1 ÉñÂí¶¼ÊǸ¡ÔÆ

²é¿´È«²¿ÆÀ·Ö

"¾õµÃºÃ£¬¾Í´òÉÍ"
»¹Ã»ÓÐÈË´òÉÍ£¬Ö§³ÖÒ»ÏÂ
·¢±íÓÚ 2020-7-4 23:56:58 | ÏÔʾȫ²¿Â¥²ã

ÃüÁî: (try-StrRegExp (atxt) "[\\d.]+")
Ñ¡ÔñµÄÎÄ×Ö HÐ͸ÖH446¡Á199¡Á8¡Á12;L=3990 È»ºó.......
Ñ¡Ôñ¶ÔÏó: ("3990" "712" "00" "78" "00" "7199" "00" "446")
cad2010¾ÍÊÇÕâôÈÎÐÔ
ºÙºÙ atxtÈç϶¨Ò壬²âÊÔÓõñȽ϶à
(defun atxt( / get_txt  )
    (if  (setq ss(entsel));Ñ¡Ôñµ¥¸öͼԪ
              (setq get_txt (cdr (assoc 1  (entget (car ss)))))
     )
     get_txt
)
·¢±íÓÚ 2022-9-12 21:54:06 | ÏÔʾȫ²¿Â¥²ã
softbird ·¢±íÓÚ 2022-9-12 06:36
ÇëÎÊÒ»ÏÂÂ¥Ö÷£¬(?

Áã¿í¶ÏÑÔautolispÖв»Ö§³Ö¡£
·¢±íÓÚ 2020-8-17 20:36:39 À´×ÔÊÖ»ú | ÏÔʾȫ²¿Â¥²ã
ÔÚ2021Ï lispsys ֵΪ1 ÕýÔò±í´ïʽµÃµ½½á¹û²»ÊÇÔ¤ÆڵĽá¹û ´ó¼ÒÓÐÊÔ¹ýô
·¢±íÓÚ 2015-10-14 17:01:22 | ÏÔʾȫ²¿Â¥²ã
¶¥,Ã÷¾­ ¾«Éñ´«³Ð, ºó¼ÌÓÐÈË°¡

ÆÀ·Ö

²ÎÓëÈËÊý 1Ã÷¾­±Ò +1 ÊÕÆð ÀíÓÉ
tryhi + 1

²é¿´È«²¿ÆÀ·Ö

·¢±íÓÚ 2015-10-15 08:33:13 | ÏÔʾȫ²¿Â¥²ã
Ã÷¾­µÄËÑË÷µÄÈ·Óе㱿
·¢±íÓÚ 2015-10-15 16:34:34 | ÏÔʾȫ²¿Â¥²ã
лл·ÖÏí£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡
·¢±íÓÚ 2015-10-16 09:20:41 | ÏÔʾȫ²¿Â¥²ã
ËäÈ»²»¶®£¬µ«ÊÇMARKÒÔ±¸Ñ§Ï°
·¢±íÓÚ 2017-10-5 20:14:44 | ÏÔʾȫ²¿Â¥²ã
»ØÌûÊÇÒ»ÖÖÃÀµÂ£¡¸Ðл¥Ö÷µÄÎÞ˽·ÖÏí лл
·¢±íÓÚ 2018-3-15 12:24:50 | ÏÔʾȫ²¿Â¥²ã
ÕæÇ¿´ó£¬Ö§³ÖÂ¥Ö÷
·¢±íÓÚ 2018-5-10 11:17:13 | ÏÔʾȫ²¿Â¥²ã
Ç¿£¬ÔÚѧϰÕýÔò
ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | ×¢²á

±¾°æ»ý·Ö¹æÔò

СºÚÎÝ|ÊÖ»ú°æ|CADÂÛ̳|CAD½Ì³Ì|CADÏÂÔØ|ÁªÏµÎÒÃÇ|¹ØÓÚÃ÷¾­|Ã÷¾­Í¨µÀ ( ÔÁICP±¸05003914ºÅ )  
©2000-2023 Ã÷¾­Í¨µÀ °æȨËùÓÐ ±¾Õ¾´úÂ룬ÔÚδȡµÃ±¾Õ¾¼°×÷ÕßÊÚȨµÄÇé¿öÏ£¬²»µÃÓÃÓÚÉÌÒµÓÃ;

GMT+8, 2024-11-22 21:37 , Processed in 0.193844 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí