lastknownuser Posted April 11, 2022 Share Posted April 11, 2022 Hi, need help with the following. How to import custom properties into my drawing from other drawing by selecting it? I tried with getfiled so I select other drawing (I get path name), but I don't know how to use "vla-get" functions to get VLA-OBJECT variable of other drawing, so I could extract custom properties from it. Quote Link to comment Share on other sites More sharing options...
mhupp Posted April 11, 2022 Share Posted April 11, 2022 This should be what you need. www.lee-mac.com/steal.html 2 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 12, 2022 Share Posted April 12, 2022 Make sure you get version 1.8 has more options. 2 Quote Link to comment Share on other sites More sharing options...
lastknownuser Posted April 12, 2022 Author Share Posted April 12, 2022 Thanks! I looked in Lee's website but didn't thought what I needed would be LISP called "steal" haha Quote Link to comment Share on other sites More sharing options...
lastknownuser Posted April 12, 2022 Author Share Posted April 12, 2022 I found some other programs so my LISP works like I want it, I get a list of custom properties by just clicking other drawing, but it only works with DWG files, could it also work with DXF? Here is the code (defun c:test_import ( / ) (setq file (getfiled "Choose file" "" "dwg;dxf" 16)) (setq ObjProp (CDP-List)) ) (defun open_dbx (dwg / dbx) (if (< (atoi (substr (getvar "ACADVER") 1 2)) 16) (setq dbx (vlax-create-object "ObjectDBX.AxDbDocument")) (setq dbx (vlax-create-object (strcat "ObjectDBX.AxDbDocument." (substr (getvar "ACADVER") 1 2))))) (vla-open dbx dwg) dbx ) (defun CDP-List ( / docProps cnt key val return) ;returns list (key . value) of all custom drawing properties if any, or nil (setq docProps (vla-get-SummaryInfo (open_dbx file))) (repeat (setq cnt (vla-NumCustomInfo docProps)) (vla-GetCustomByIndex docProps (setq cnt (1- cnt)) 'key 'val) (setq return (cons (cons key val) return)) );repeat return ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 13, 2022 Share Posted April 13, 2022 A dxf file is a great big text file and that is bottom line, like others no way am I spending hours coding to find the match text keys and subsequent text values, just open a dxf with say notepad and have a look. Quote Link to comment Share on other sites More sharing options...
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.