GISdude Posted April 25, 2013 Posted April 25, 2013 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, Quote
pBe Posted April 25, 2013 Posted April 25, 2013 ODBX Wrapper by LM Attribute Functions by LM Afralisp AddTextMethod Welcome to CADTutor GISdude Quote
GISdude Posted April 26, 2013 Author Posted April 26, 2013 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! Quote
pBe Posted April 26, 2013 Posted April 26, 2013 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. Quote
Recommended Posts
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.