Message 1 of 4
Lisp & DBX

Not applicable
11-23-2015
12:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I use a translator, so sorry for my English.
I have such a problem here.
I'm in the file 'plan.dwg'.
Use the
(setq MyHandle "223") ; Handle element which wishes to change, which is in the file 'cross.dwg'
(setq file "C:\\temp\\cross.dwg")
(setq dbx (vla-getInterfaceObject(vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (substr (getvar "ACADVER") 1 2)))) (vla-open dbx file)
get to the file 'cross.dwg', in which there is an element (an element of type 'TEXT' in modelspace) which I seek by using the
(vlax-for %1 (vla-get-modelspace dbx) (if (= (vla-get-Handle %1) MyHandle) (progn
(setq txt (vla-get-TextString %1)) (acet-ui-message (strcat "I have \n\"" txt "\"") "attempt" 65) ) ) ) (vlax-release-object dbx)
What do I do now to change the content (TextString) this item?
Below the code.
(defun c:polki ( / MyHandle file dbx %1 txt) (setq MyHandle "223"); Handle element which wishes to change, which is in the file 'cross.dwg' (setq file "C:\\temp\\cross.dwg") (setq dbx (vla-getInterfaceObject(vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (substr (getvar "ACADVER") 1 2)))) (vla-open dbx file) (vlax-for %1 (vla-get-modelspace dbx) (if (= (vla-get-Handle %1) MyHandle) (progn (setq txt (vla-get-TextString %1)) (acet-ui-message (strcat "I have\n\"" txt "\"") "attempt" 65) ;Here you want to change the content of this item -> %1 ; (vla-put-TextString -> What's next? ) ) ) (vlax-release-object dbx) )
Jerzy