Jump to content

Recommended Posts

Posted

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	

Posted

Change:

 

(setq SS (ssget "X" (list (cons 0 "INSERT"))))

 

To:

 

(setq SS (ssget (list (cons 0 "INSERT"))))

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...