poorestchump Posted April 8, 2010 Share Posted April 8, 2010 I don't know enough about vlisp to do this on my own. I've attached a dwg with dynamic blocks and a routine that numbers parts and totals the qty's. I need another routine that will find the distance from a stretch parameter created in the block editor so that only identically named parts with the same length will show up on the same line in a data extraction table. I can't find anything anywhere that shows how this might be done. Please help me:( Thanks in advance, jb junk.dwg 333.LSP Quote Link to comment Share on other sites More sharing options...
ollie Posted April 9, 2010 Share Posted April 9, 2010 Hi The below code will set you on your way. Once you select a block it will list the attibutes and their corresponding values in the command line (vl-load-com) (defun c:gdi( / ) (setq ent (vlax-ename->vla-object (car (entsel "\nSelect block")))) (if(=(vla-get-hasattributes ent) :vlax-true) (progn (foreach att(vlax-safearray->list(vlax-variant-value(vla-getattributes ent))) (princ (strcat "\n" (vla-get-tagstring att) ": " (vla-get-textstring att) )) ) ) ) ) Hope this helps Ollie Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 9, 2010 Share Posted April 9, 2010 Here's one way to get Dynamic Block Properties: (defun GetDynProps (obj) (if (eq :vlax-true (vla-get-isDynamicBlock obj)) (mapcar (function (lambda (x) (list (vla-get-PropertyName x) (if (= 8192 (logand 8192 (vlax-variant-type (setq var (vla-get-value x))))) (vlax-safearray->list (vlax-variant-value var)) (vlax-variant-value var))))) (vlax-invoke obj 'GetDynamicBlockProperties)))) And another (defun GetDynProps (obj) (if (eq :vlax-true (vla-get-isDynamicBlock obj)) (mapcar (function (lambda (x) (list (vla-get-PropertyName x) (vlax-get x 'Value)))) (vlax-invoke obj 'GetDynamicBlockProperties)))) 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.