Guest Posted April 7, 2017 Posted April 7, 2017 Hi i am using this code to change the block scale factor x,y,z to 1. This routine is not working properly with all my blocks and i dont know why !! I need to do a change in this code. I want to select with window all my blocks and then change the scale factor. I believe tha this change will solve the propblem. Can any one help. Thanks (defun C:BS ( / SS ent vla-obj ) (vl-load-com) (if (setq SS (ssget "X" (list (cons 0 "INSERT")))) (repeat (setq i (sslength SS)) (setq ent (ssname SS (setq i (1- i)))) (setq vla-obj (vlax-ename->vla-object ent)) (if (and (or (not (= (vla-get-XScaleFactor vla-obj) 1.0)) (not (= (vla-get-YScaleFactor vla-obj) 1.0)) (not (= (vla-get-ZScaleFactor vla-obj) 1.0)) ) ; (vlax-get-IsDynamicBlock vla-obj :vlax-true) (vlax-property-available-p vla-obj 'EffectiveName) (member (vlax-get vla-obj 'EffectiveName) '("AnnotPoint" "AnnotRepers" "AnnotKORYFES" "Annotstation" "AnnotTrigonom" "AnnotKOKAEK" "AnnotKOROT" "AnnotARID1" "AnnotAROT1" "AnnotDEH1" "Annotdvelos" "AnnotEikonastasi" "AnnotFANARI" "Annotkrounos" "AnnotMPASKETA" "AnnotOTE1" "AnnotSHMA1" "AnnotSHMA2" "AnnotSHMA3" "Annotstathmi" "Annotstayros" "annotTREE1" "annotTREE2" "annotTREE3" "annotTREE4" "annotTREE5" "annotTREE6" "annotTREE7" "annotTREE8" "annotTREE9" "annotTREE10" "annotTREE11" "annotTREE12" "annotTREE13" "AnnotNORTH" "Annotodsta" "Annotodtrig" "Annotvana" "Annotvelos") ) ) (progn (vla-put-XScaleFactor vla-obj 1.0) (vlax-put-property vla-obj 'YScaleFactor 1.0) (vlax-put vla-obj 'ZScaleFactor 1.0) ) ) );repeat ) (vla-Regen (vla-get-ActiveDocument (vlax-get-acad-object)) acActiveViewport) (princ) );defun Quote
Hippe013 Posted April 7, 2017 Posted April 7, 2017 Change: (setq SS (ssget "X" (list (cons 0 "INSERT")))) To: (setq SS (ssget (list (cons 0 "INSERT")))) 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.