winabcd 发表于 2007-6-25 10:28:00

读取自定义图形特性

<p>我用</p><p>(vlax-invoke-method objPros 'SetCustomByIndex&nbsp;0 pKey pValue)</p><p>可以设置一个自定义图形特性。</p><p>可当我用</p><p>(vlax-invoke-method objPros 'GetCustomByIndex&nbsp;0 pKey pValue)</p><p>读自定义图形特性时,却读不到。读完以后的pKey、pValue的值还是我在读特性以前设置的值,我设置的值明显和对话框中的值不一样。不知道问题出在哪,请各位指教。</p>

caoyin 发表于 2007-6-25 10:37:00

<p>(vlax-invoke-method objPros 'GetCustomByIndex&nbsp;0 'pKey 'pValue)</p><p>(list pKey pValue)</p>

winabcd 发表于 2007-6-25 11:09:00

<p>原来问题出在这儿</p><p>谢谢楼上的指教!!!</p>

z16 发表于 2013-1-17 21:23:46

(repeat (vla-NumCustomInfo DwgProps)

   (vla-GetCustomByIndex DwgProps i 's1 's2)

   (princ (strcat "\n" s1 " ->> " s2))

;;;vla-RemoveCustomByIndex DwgProps i)

   (setq i (1+ i))

   )

z16 发表于 2013-1-17 21:24:19

(setq        DwgProps (vla-Get-SummaryInfo
                   (vla-Get-ActiveDocument (vlax-Get-Acad-Object))
               )
   )
   (vla-Put-Author DwgProps "Author")

   (vla-Put-Subject DwgProps "Subject")

   (vla-Put-Title DwgProps "Title")

   (vla-Put-RevisionNumber DwgProps "Revision")

   (vla-AddCustomInfo DwgProps "Item" "Value")

   (repeat (vla-NumCustomInfo DwgProps)

   (vla-GetCustomByIndex DwgProps i 's1 's2)

   (princ (strcat "\n" s1 " ->> " s2))

;;;vla-RemoveCustomByIndex DwgProps i)

   (setq i (1+ i))

   )
;;;end repeat

页: [1]
查看完整版本: 读取自定义图形特性