ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

§å¦¸¶ñ¤JautocadÀɦW

§å¦¸¶ñ¤JautocadÀɦW

¥»©«³Ì«á¥Ñ carzyindex ©ó 2011-5-26 15:26 ½s¿è

¦]¤u§@»Ý­n

§Æ±æcadÀÉÀɦW¶ñ¤J¹Ïµe¬Y¦ì¸m

(defun c:ppp(/)
  (command ".style" "htx1" "" "" "" "" "" "" "")
  (setq p1(getvar"dwgname"))
  (setq p2 (substr p1 1 (- (strlen p1) 4)))
  (command "Text" '(345 7) 2.3 0 p2)
)
-----------------------------------------------------------------
.style¬O¦r«¬

¦ý¬O¤£¾å±o«ç¼Ë©MexcelÀɵ²¦X

¸É¥R»¡©ú
±Nppp.txt©ñ¤J c:

¶}±Òautocad    ¦b¤U¤è«ü¥O¿é¤J
(load"c:\\ppp.txt")

¶×¤J¦¨¥\«á   ¦A¿é¤J

(c:ppp)

´N¯à±NÀɮצWºÙ©ñ¦bcad¸Ì¯S©wªº¦ì¸m

¦ý¬OÀɮ׫ܦh§Æ±æ¥i¥Îexcel§å¦¸§¹¦¨

ppp.rar (208 Bytes)

¥i¯à­n³Â·Ð§A´£¨Ñ±µªñ¹ê»Ú±¡§Îªº½d¨ÒÀÉ®×,
¤£µM¤£ª¾§A­n§ì¤°»ò¸ê®Æ­n¨ì©³¬O­n©ñ¨ì­þ¸Ì¥h?
¤W­±¨º¨Çµ{¦¡«ü¥O¤£¬O Excel VBA ªº¶Ü?
¦n¹³¤£´¿¬Ý¹L©O.

TOP

¦^´_ 2# luhpro


    ¤W­±«ü¥O¬Oautolisp

TOP

¦^´_ carzyindex
§Æ±æcadÀÉÀɦW¶ñ¤J¹Ïµe¬Y¦ì¸m
VBA¦n¹³¨S³o¥\¯à

TOP

¥»©«³Ì«á¥Ñ carzyindex ©ó 2011-5-26 10:44 ½s¿è

¦^´_ 4# GBKEE


    vba¥i¥H¶}±Òautocad¤£¬O¶Ü
http://blog.xuite.net/pertonchang/prog/14795319

§å¦¸¶}±Ò²M³æ¤¤cadÀÉ   ¦A¥Îcad¸Ì­±ªº¥\¯à°Ê§@
¨Ò¦p
9164ARP0-0012.dwg        OCTPA-LCX66005A-001-00.dwg
9164ARP0-0013.dwg        OCTPA-LCX66005A-002-00.dwg
9164ARP0-0014.dwg        OCTPA-LCX66005A-003-00.dwg

cad¸Ì­±¦³«Ü¦h»²§Uµ{¦¡¤£ª¾¸Ó¦p¦ó§¹¦¨°Ê§@

TOP

¦^´_ 5# carzyindex
¨º´N­n½Ð¦³AutoCadªº¨Ó¦^µª¤F.
§Ú¹ïAutoCad§¹¥þ¬Oªù¥~º~

TOP

¦^´_ 6# GBKEE


    ·PÁª©¤j¦^ÂÐ

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2011-5-27 00:08 ½s¿è

¦^´_ 5# carzyindex
¦]¬°¦Û¤v¨S¦³AutoCad³nÅé©Ò¥H¤£¯à¹ê§@¬ÛÃöµ{¦¡,
¤£¹LÁÙ¬O¥i¥H´£¨Ñ¤@¨Ç«Øijµ¹§A°Ñ¦Ò :
¥ý¨Ì·Ó¸Óºô­¶«Ø¥ß AutoCad ¬ÛÃöªº¦s¨ú¤¸¥ó, (Dim ...    Set ... ¨º¨â¦æ)
µM«á«ö F8 ³æ¨B°õ¦æ§¹¨º¨â¦æ, (©³¤U¥i¥H¥ý©ñ¤@¨Ç¤£¼vÅTµ²ªGªºµ{¦¡±Ô­z ¨Ò¦p : iI = 1 ¤§Ãþªº¥HÅýµ{¦¡¦³¦a¤è¥i¥H¼È°±¦Ó¤£¬O¶]¨ì End Sub)
±µµÛ¤â°Ê¿é¤J oAutoCat.  ©ó¿é¤J . «áÀ³¸Ó·|¬Ý¨ì¤@°ï¥i¥Î¤èªk©ÎÅܼƦWºÙ(¨Ò¦p : Visible  ¤§Ãþªº),
(©Î¬O¤]¥i¥H¶}±Ò "§Y®É¹Bºâ" µøµ¡¥´¤W oAutoCat. )
¿ï¥ô¤@­Ó¶µ¥Ø«á¬Ý¬O«ö Enter ÁäÁÙ¬O¥´¤W ( ¥ç©Î¬O =    (¥i¥Hª¾¨ì¥¦»Ý­n¤°»òªF¦è¨Ó§¹¦¨°Ê§@)
±µµÛ«ö F8 °õ¦æ¸Ó«ü¥O«á¥i¨Ì¾Ú¿ù»~°T®§¥i¥H¬Ý¥X¦p¦ó¥h§¹µ½¥¦.(­Y©ó "§Y®É¹Bºâ" µøµ¡ «h¥iª½±µ«ö Enter Áä°õ¦æ¥¦)

¤£¹L³o¬O¼É¤O¿Ô¸ß Excel ªº¤è¦¡,
­n¦³ Excel ·í±¼¤Î­«¶}¾÷ªº¤ß²z·Ç³Æ,
½Ð¦Û¦æ·r°u¬O§_­n±Ä¥Î.

TOP

¦^´_ 8# luhpro


    ·PÁ§Aªº¦^ÂÐ

TOP

¥»©«³Ì«á¥Ñ ¨F©Ôªo ©ó 2011-5-27 23:25 ½s¿è

¤£»Ý­n¥ÎEXCEL¡AAutocad ¥»¨­´N¯à°õ¦æ VBA
©³¤U¬O Autocad VBA ³á¡ã¤£¯à¦b Excel VBA ¸Ì­±°õ¦æªº
  1.     Dim cadapp, caddoc, DWG_Dir, DWG_Name
  2.     Set cadapp = Application
  3.     '¶}±Ò C:\ ©³¤U©Ò¦³ªº dwg ÀÉ®×
  4.     DWG_Dir = "C:\"
  5.     DWG_Name = Dir(DWG_Dir & "*.dwg", 0)
  6.     Do While DWG_Name <> ""
  7.         Set caddoc = cadapp.Documents.Open(DWG_Dir & DWG_Name)
  8.         '¦bÀÉ®×°õ¦æ©R¥O
  9.         caddoc.SendCommand "(load""c:\\ppp.txt"")" & vbCr
  10.         '¦bÀÉ®×°õ¦æ©R¥O
  11.         caddoc.SendCommand "ppp" & vbCr
  12.         DWG_Name = Dir
  13.     Loop
½Æ»s¥N½X
¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD