Jump to content

Recommended Posts

Posted

Hi All,

 

I have a routine to change styles on various objects but was wondering how to tweak it so it runs only on selected objects as opposed to globally?

 

(defun c:Changestyle (/ style sset ename i)
  (vl-load-com)
  (while
    (not
      (and
	(setq style (getstring "\nEnter the style name: "))
	(tblsearch "style" style)
      )
    )
     (princ (strcat "\nThe style '" style '" do not exist."))
  )
  (setq i 0)
  (setq sset (ssget "X" '((-4 . "<OR") (0 . "MTEXT") (0 . "TEXT") (0 . "attdef") (0 . "dimension") (0 . "leader") (0 . "multileader") (-4 . "OR>"))))
  (if sset
    (repeat (sslength sset)
      (setq ename (ssname sset i))
      (setq i (1+ i))
      (vla-put-stylename (vlax-ename->vla-object ename) style)
    )
  )
  (setq sset nil)
)

 

Posted

Try removing "X" from the SSGET

(ssget '((-4 . "<OR") (0 . "MTEXT") (0 . "TEXT") (0 . "attdef") (0 . "dimension") (0 . "leader") (0 . "multileader") (-4 . "OR>"))))

 

  • Like 1

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