Jump to content

apply predefined set of properties to existing objects


samifox

Recommended Posts

hi

 

using acad 18

 

i need what the "Match" command is doing but without a scoure object.

i have predefined set of properties i want to apply to existing objects.

 

what is the way to automate it?

Link to comment
Share on other sites

You could modify this to whatever properties you want.

; Written By: Peter Jamtgaard 2002
; This program will prompt the user to ceate a selection set. 
; All objects in the selection set will have their color 
; and linetype properties set to bylayer.

(defun C:ByLayer (/ CNT EOBJ SSET)
(princ "Select Entities to change")
(setq SSET (ssget)
      CNT  0
)
(repeat (sslength SSET)
 (setq ENAM (ssname SSET CNT)
       CNT  (1+ CNT)
       EOBJ (vlax-ename->vla-object ENAM)
 )
 (vl-catch-all-apply 
  'vla-put-color 
  (list EOBJ 256)
 )
 (vl-catch-all-apply
  'vla-put-linetype 
  (list EOBJ "Bylayer")
 )
 (vl-catch-all-apply
  'vla-put-Lineweight 
  (list EOBJ -1)
 )
 (vl-catch-all-apply
  'vla-put-PlotStyleName 
  (list EOBJ "Bylayer")
 )
)
)

Link to comment
Share on other sites

Something like this that could be typed at the command line by modifying the previous code posted then its not hard coded. This would be about the same time as answering questions.

 

(mychprop colour linetype  layer freeze)

(mychprop 3 "dashed" "22" "")
use a "" as dont change but you must supply all 4
(mychprop "" "Continous" "" "")

Link to comment
Share on other sites

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