Lee Mac Posted August 14, 2009 Share Posted August 14, 2009 Ok I've experimented a bit, try this instead: (defun c:bu (/ *error* doc oldc ss sel scl) (vl-load-com) (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if oldc (setvar "CMDECHO" oldc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldc (getvar "CMDECHO") scl (getvar "DIMSCALE")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (progn (vla-StartUndoMark doc) (command "_.-objectscale" ss "" "_add" "1:1" "") (setvar "CANNOSCALE" "1:1") (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc)) (foreach x (if (eq :vlax-true (vla-get-IsDynamicBlock Obj)) '(XEffectiveScaleFactor YEffectiveScaleFactor ZEffectiveScaleFactor) '(XScaleFactor YScaleFactor ZScaleFactor)) (vlax-put-property Obj x scl)) (command "_.attsync" "_Name" (vla-get-Name Obj))) (vla-delete sel) (vla-EndUndoMark doc))) (setvar "CMDECHO" oldc) (princ)) Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted August 14, 2009 Share Posted August 14, 2009 Ok I've experimented a bit, try this instead: (defun c:bu (/ *error* doc oldc ss sel scl) (vl-load-com) (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if oldc (setvar "CMDECHO" oldc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldc (getvar "CMDECHO") scl (getvar "DIMSCALE")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (progn (vla-StartUndoMark doc) (command "_.-objectscale" ss "" "_add" "1:1" "") (setvar "CANNOSCALE" "1:1") (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc)) (foreach x (if (eq :vlax-true (vla-get-IsDynamicBlock Obj)) '(XEffectiveScaleFactor YEffectiveScaleFactor ZEffectiveScaleFactor) '(XScaleFactor YScaleFactor ZScaleFactor)) (vlax-put-property Obj x scl)) (command "_.attsync" "_Name" (vla-get-Name Obj))) (vla-delete sel) (vla-EndUndoMark doc))) (setvar "CMDECHO" oldc) (princ)) well. There are new names and stuff.. but even then the result is the same... those things won't show... still my bu.lsp just skipping the named 0* blocks is the option... I guess we can stick with this until I find the option to add the block name list... but I will try it tomorrow in my off-work time. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 14, 2009 Share Posted August 14, 2009 Sorry, I forgot something, try this: (defun c:bu (/ *error* doc oldc ss sel scl) (vl-load-com) (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if oldc (setvar "CMDECHO" oldc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldc (getvar "CMDECHO") scl (getvar "DIMSCALE")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (progn (vla-StartUndoMark doc) (command "_.-objectscale" ss "" "_add" "1:1" "") (setvar "CANNOSCALE" "1:1") (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc)) (foreach x (if (eq :vlax-true (vla-get-IsDynamicBlock Obj)) '(XEffectiveScaleFactor YEffectiveScaleFactor ZEffectiveScaleFactor) '(XScaleFactor YScaleFactor ZScaleFactor)) (vlax-put-property Obj x scl)) (command "_.attsync" "_Name" (vlax-get-property Obj (if (eq :vlax-true (vla-get-isDynamicBlock Obj)) 'EffectiveName 'Name)))) (vla-delete sel) (vla-EndUndoMark doc))) (setvar "CMDECHO" oldc) (princ)) Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted August 14, 2009 Share Posted August 14, 2009 ooo my goonies... It's aliiveee!! It really works now... I don't know how much you did, but it really works completely now... it seems there's nothing impossible for you. How much do I owe you now? If 100 dlls per hour... and you took about 5 or 6... this lisp is going to be expensive now ...my entire 2 weeks paycheck... :s Hope I can pay with my "complete web autocad blocks collection" available in less than a month... I will use it from now on... Now that's what I call a lisp. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 14, 2009 Share Posted August 14, 2009 ooo my goonies... It's aliiveee!! It really works now... I don't know how much you did, but it really works completely now... it seems there's nothing impossible for you. How much do I owe you now? If 100 dlls per hour... and you took about 5 or 6... this lisp is going to be expensive now ...my entire 2 weeks paycheck... :s Hope I can pay with my "complete web autocad blocks collection" available in less than a month... I will use it from now on... Now that's what I call a lisp. Glad you like it. Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted September 4, 2009 Share Posted September 4, 2009 Glad you like it. Ooou no... guess what?.... I have been using this beauty... but today I found that I cannot select normal blocks with the last version.. only dynamic blocks... I didn't realize of it until now... If anything is possible... is it possible to make it work with normal and dynamic blocks at once?.. I thought it was doing it before... but I was actually using my old version where all blocks were being sincronized (My Pc was loading automatically the old version) I like your version, but it now won´t let me select normal blocks... is it fixable? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2009 Share Posted September 5, 2009 You should be able to select normal blocks - but it will only allow attributed blocks. Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted September 5, 2009 Share Posted September 5, 2009 You should be able to select normal blocks - but it will only allow attributed blocks. Well, I checked it out again... and yes, it just allow attributed blocks, that's what I want to change... In my case we have a standard library combining normal, attributed and dynamic blocks... so I need this routine to work on all of them at the same time... I got my previous version that was sincronizing them all, then I made it to sincronized all but those starting with 0 (cero), and it still works for my case, but yours was better in order to sincronize only selected blocks, but if it doesn't work with normal blocks... it becomes useless for my purpose. Well, you don´t need to waste more time in it.. but well... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2009 Share Posted September 5, 2009 Try this: (defun c:bu (/ *error* doc oldc ss sel scl) (vl-load-com) (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if oldc (setvar "CMDECHO" oldc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldc (getvar "CMDECHO") scl (getvar "DIMSCALE")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "INSERT")))) (progn (vla-StartUndoMark doc) (command "_.-objectscale" ss "" "_add" "1:1" "") (setvar "CANNOSCALE" "1:1") (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc)) (foreach x (if (eq :vlax-true (vla-get-IsDynamicBlock Obj)) '(XEffectiveScaleFactor YEffectiveScaleFactor ZEffectiveScaleFactor) '(XScaleFactor YScaleFactor ZScaleFactor)) (vlax-put-property Obj x scl)) (if (eq :vlax-true (vla-get-HasAttributes Obj)) (command "_.attsync" "_Name" (vlax-get-property Obj (if (eq :vlax-true (vla-get-isDynamicBlock Obj)) 'EffectiveName 'Name))))) (vla-delete sel) (vla-EndUndoMark doc))) (setvar "CMDECHO" oldc) (princ)) Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted September 5, 2009 Share Posted September 5, 2009 Ok I've experimented a bit, try this instead: (defun c:bu (/ *error* doc oldc ss sel scl) (vl-load-com) (defun *error* (msg) (if doc (vla-EndUndoMark doc)) (if oldc (setvar "CMDECHO" oldc)) (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq oldc (getvar "CMDECHO") scl (getvar "DIMSCALE")) (setvar "CMDECHO" 0) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (progn (vla-StartUndoMark doc) (command "_.-objectscale" ss "" "_add" "1:1" "") (setvar "CANNOSCALE" "1:1") (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet doc)) (foreach x (if (eq :vlax-true (vla-get-IsDynamicBlock Obj)) '(XEffectiveScaleFactor YEffectiveScaleFactor ZEffectiveScaleFactor) '(XScaleFactor YScaleFactor ZScaleFactor)) (vlax-put-property Obj x scl)) (command "_.attsync" "_Name" (vla-get-Name Obj))) (vla-delete sel) (vla-EndUndoMark doc))) (setvar "CMDECHO" oldc) (princ)) Aneenee... It works... I am gonna check what you did... I don´t know anyhting about vlisp but... I already started with the Purgefiles.lsp by adding a line to audit... and worked... that's a start. And thanks for it... Faith returned to my heart. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2009 Share Posted September 5, 2009 Glad it works for you 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.