Jump to content

Can't collect the same result


ahyin

Recommended Posts

Dear all,

anyone can tell me why I put the same code into AutoCAD 2007 & 2011 is return result is not the same.

(entget (vlax-vla-object->ename (vla-item (vla-item (vlax-ename->vla-object (namedobjdict)) "AEC_VARS") "AEC_VARS_DWG_SETUP")))

AutoCAD 2007 ----->

((-1 . ) (0 . "AEC_VARS_DWG_SETUP") (5 . "48") (102 . "{ACAD_XDICTIONARY") (360 . ) (102 . "}") (102 . "{ACAD_REACTORS") (330 . ) (102 . "}") (330 . ) (100 . "AecDbObject") (102 . "{AEC_SUBOBJECT") (300 . "AecImpDictRecord") (100 . "AecImpObj") (3 . "") (100 . "AecImpDictRecord") (3 . "") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 . "AecDbDictRecord") (100 . "AecDbVars") (100 . "AecDbVarsDwgSetup") (70 . 0) (71 . 30) (72 . 2) (73 . 2) (74 . 0) (75 . 0) (76 . 2) (77 . 2) (78 . 4) (79 . 2) (10 0.0 0.0 0.0) (11 0.0 0.0 0.0) (50 . 0.0) (40 . 100.0) (41 . 96.0) (42 . 0.00542501) (44 . 0.0625) (45 . 96.0) (46 . 0.3048) (90 . 0) (91 . 4096) (92 . 0) (270 . 56) (271 . 2) (272 . 130) (273 . 2) (2 . " sq ft") (3 . " cu ft") (4 . "ACADARCH") (6 . "L120") (7 . "'") (8 . "m") (330 . ) (9 . "") (43 . 0.0416667) (5 . "AecLayerStd.dwg") (171 . 1) (172 . 1) (173 . 1) (174 . 1) (175 . 25) (280 . 1))

But the same code put into AutoCAD 2011, it return like this :

((-1 . ) (0 . "AEC_VARS_DWG_SETUP") (5 . "48") (102 . "{ACAD_XDICTIONARY") (360 . ) (102 . "}") (102 . "{ACAD_REACTORS") (330 . ) (102 . "}") (330 . ))

Link to comment
Share on other sites

With the jump to .net, less and less object properties in the vertical products (arch, civil 3d, mech, etc.) are available to LISP.

Use vlax-object-dump and you'll get more properties.

Link to comment
Share on other sites

 
(defun c:dump ( / *error* grpoint gr e )
 (vl-load-com)
 (defun *error* ( msg )
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **"))
   )
   (princ)
 )
 (defun grpoint ( / gr ss )
   (while 
     (eq 5 (car (setq gr (grread t 15 2))))
     (setvar 'lastpoint (cadr gr))
   )
   (list (car gr)(getvar 'lastpoint))
 )
 (while
   (not
     (and
       (princ "\n*To view properties & methods select an object or right click on an object to select the nested object (press any key to cancel)*")
       (setq gr (grpoint))
       (cond
         ( (and (eq 25 (car gr))(setq e (car (nentselp (cadr gr)))))
           (setq e (vlax-ename->vla-object e))
         )
         ( (and (eq 3 (car gr))(setq e (ssget (cadr gr))))
           (setq e (vlax-ename->vla-object (ssname e 0)))
         )
         ( (or (eq 25 (car gr))(eq 3 (car gr)))
           (prompt "\nMissed! Try again!")
         )
         (t (prompt "*Cancel*")(exit))
       )
     )
   )
 )
 (vlax-dump-object e t)
 (textscr)
 (princ)
)

 

 

I know this really isn't called for but I'm bored

Link to comment
Share on other sites

Thanks , actually I want to get back the item (270 . 56 ) for check, but in Architecture 2011 unable to get back this item. Any other methods to replace it ?

((-1 . <Entity name: 7ed2de40>) (0 . "AEC_VARS_DWG_SETUP") (5 . "48") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7ed33f18>) (102 . "}") (102 . "{ACAD_REACTORS") (330 . <Entity name: 7ed2de18>) (102 . "}") (330 . <Entity name: 7ed2de18>) (100 . "AecDbObject") (102 . "{AEC_SUBOBJECT") (300 . "AecImpDictRecord") (100 . "AecImpObj") (3 . "") (100 . "AecImpDictRecord") (3 . "") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 . "AecDbDictRecord") (100 . "AecDbVars") (100 . "AecDbVarsDwgSetup") (70 . 0) (71 . 30) (72 . 2) (73 . 2) (74 . 0) (75 . 0) (76 . 2) (77 . 2) (78 . 4) (79 . 2) (10 0.0 0.0 0.0) (11 0.0 0.0 0.0) (50 . 0.0) (40 . 100.0) (41 . 96.0) (42 . 0.00542501) (44 . 0.0625) (45 . 96.0) (46 . 0.304 (90 . 0) (91 . 4096) (92 . 0) [color="red"](270 . 56) [/color](271 . 2) (272 . 130) (273 . 2) (2 . " sq ft") (3 . " cu ft") (4 . "ACADARCH") (6 . "L120") (7 . "'") (8 . "m") (330 . <Entity name: 0>) (9 . "") (43 . 0.0416667) (5 . "AecLayerStd.dwg") (171 . 1) (172 . 1) (173 . 1) (174 . 1) (175 . 25) (280 . 1))

Edited by ahyin
Link to comment
Share on other sites

 
(defun c:dump ( / *error* grpoint gr e )
 (vl-load-com)
 (defun *error* ( msg )
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **"))
   )
   (princ)
 )
 (defun grpoint ( / gr ss )
   (while 
     (eq 5 (car (setq gr (grread t 15 2))))
     (setvar 'lastpoint (cadr gr))
   )
   (list (car gr)(getvar 'lastpoint))
 )
 (while
   (not
     (and
       (princ "\n*To view properties & methods select an object or right click on an object to select the nested object (press any key to cancel)*")
       (setq gr (grpoint))
       (cond
         ( (and (eq 25 (car gr))(setq e (car (nentselp (cadr gr)))))
           (setq e (vlax-ename->vla-object e))
         )
         ( (and (eq 3 (car gr))(setq e (ssget (cadr gr))))
           (setq e (vlax-ename->vla-object (ssname e 0)))
         )
         ( (or (eq 25 (car gr))(eq 3 (car gr)))
           (prompt "\nMissed! Try again!")
         )
         (t (prompt "*Cancel*")(exit))
       )
     )
   )
 )
 (vlax-dump-object e t)
 (textscr)
 (princ)
)

 

 

I know this really isn't called for but I'm bored

Thank you ! But it can't get the drawing units from CAD file. Can you tell how to get the drawing units by lisp.

Link to comment
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
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...