Jump to content
GISdude

extract and copy attribute and move to X,Y coordinate

Recommended Posts

GISdude

Hi all,

I've just been given the mother of all assignments. I have abou 490 dwg files that have a title block in model space that is an old one and I've been told to take the dwg number and place it in a X,Y position in model space.

As far as I know, the title blocks for all 490 files is the exact same one, however, the drawing numbers are all different.

I can't open up all 490 drawings, that would drive me insane. If anyone would point me in the right direction for doing this, that would be great, otherwise...

 

I have a basic idea for the pseudo code and am formulating some code in my head, but if anyone has a better idea...

 

Many thanks for any help,

Share this post


Link to post
Share on other sites
GISdude

pBE, I'm looking at the code for the OBJECTDBX wrapper. The comments say "function requiring an argument (VLA document object). I assume that object comes in MAP3D or vanilla AutoCAD?

 

The code for asking for user input for browsing the file directory is awesome!

Share this post


Link to post
Share on other sites
pBe
The code for asking for user input for browsing the file directory is awesome!

 

Indeed it is. that's our LM :)

 

pBE, I'm looking at the code for the OBJECTDBX wrapper. The comments say "function requiring an argument (VLA document object). I assume that object comes in MAP3D or vanilla AutoCAD?

 

Well not really, the "function" with a single argument in this case is the VLA document object. normally you will see this on a routine that runs on an opened/active drawing as:

 

(setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))

 

Now the task of retrieving this VLA Document on a non-opened/non-active drawing falls with the function LM:ODBX.

 

Which will supply the "doc" argument to the helper function

 

(LM:ODBX
     '(lambda ( [b]doc [/b]) (vla-get-count (vla-get-layouts doc)))
      nil
      nil
   )

 

(defun _lockalllayers ( [b]doc[/b] ); function with a single argument
       (vlax-for layer (vla-get-layers doc)
           (vla-put-lock layer :vlax-true)
       )
   )

   (LM:ODBX [b]'_lockalllayers [/b]nil t)

 

Got it?

 

OAN: Its been a while since i visited LM's website. The wrapper is totally different from the one i saw before. Cleaner and more descriptive.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...