Jump to content

Stip all text fields using Visual LISP - ObjectDBX


broncos15

Recommended Posts

So I am working on a program that would make use of Lee Mac's ObjectDBX Wrapper found at http://www.lee-mac.com/odbxbase.html. The purpose of the program is to strip all fields in text, mtext, multileaders, dimensions, and blocks then replace them with just the text value (i.e. if the field had 5' it would be replaced with just text that says 5') in all drawings in a particular folder. I know how to do this using just dxf codes but my solution has to use Visual LISP because of the limitations of ObjectDBX. My quick solution for mtext for example, is to do something like this:

  (setq txt (vla-get-textstring obj))  
 (vla-put-textstring obj "Hi")
 (vla-put-textstring obj txt)

This seems to work fine, but I am unsure if this would work all of the time? Could I use this same idea for blocks and dimensions as well?

Link to comment
Share on other sites

The vla-put-textstring may vary within the object type, for text, mtext it will work in a block you need to get-attributes then vla-put-textstring att "hi" same with dims but Measurement = 4609.26 not textstring. Use dumpit.lsp to find.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...