Jump to content

Atrribute width


Jimmy Sean

Recommended Posts

We use this lisp routine to change the attribute width in a block but since we have converted our block to being annotative it does not function correctly. When selecting a block the attribute gets really large and I’m not sure how to fix the routine so that the attribute does not get bigger in size.

Would someone point me in the right direction?

 

 

 

; WIDEDIT.LSP    c.2000  Rob Herr
; 'Edit Nested Attribute Width'    v 1.0    17 Feb 2000
;
; This routine lets you modify the width of and attribute in a block 
; without exploding the attribute
;
; Pick one attribute. The current width is given and you are prompted
; for a new width. Works with Attributes also Attributes within blocks.
; 
;  ___________________________________________________________________
;  |     PERMISSION HEREBY GRANTED BLA, BLA, BLA, TO MODIFY ETC.     |
;  |   As long as name and email remain with the original program    |
;  | unaltered. However I would like to know of any bugs or problems |
;  |   that arise with the actual program. And of course I take no   |
;  |  responsibility for lost limbs, auto repair bills, mechanical   |
;  |         or electronic difficulties, or snake venom.             |
;  -------------------------------------------------------------------

(defun c:widedit (/ attent typ wd uwd)
(setvar "CMDECHO" 0)
(setq attent (entget (car (nentsel "\nSelect attribute: "))))
(setq typ (cdr (assoc 0 attent)))
(if
 (cond
  ((= typ "ATTRIB"))
  ((= typ "T"))
 )
 (progn
  (setq wd (rtos (cdr (assoc 41 attent)) 2))
  (prompt (strcat "\nCurrent Width is <"wd"> "))
  (setq uwd (getreal "\nEnter new width... "))
  (setq attent (subst (cons 41 uwd) (assoc 41 attent) attent))
  (entmod attent)
  (command "REGEN")
 )
 (prompt "\nNo Attributes Selected")
)
(setvar "CMDECHO" 1)
(prompt "\nBy Rob Herr")(print)
)

 

 

Thanks,

Sean

Link to comment
Share on other sites

It will be based on a percentage of the cannoscale or cannoscalevalue.

 

eg.

Instead of 1.6 for 20 scale (0.8 times scale), it would be 0.8 for 20 scale. In code, you could just divide the 1.6 by your scale to get the correct number.

Link to comment
Share on other sites

I think you've also made the attribute annotative. You must only make the block annotatative, not the attribute!

If you have also made the attribute annotative it will scale twice (=quadratic): with the block and on it's own.

Link to comment
Share on other sites

It will be based on a percentage of the cannoscale or cannoscalevalue.

 

eg.

Instead of 1.6 for 20 scale (0.8 times scale), it would be 0.8 for 20 scale. In code, you could just divide the 1.6 by your scale to get the correct number.

 

 

Sorry I'm not following your example. :oops:

Link to comment
Share on other sites

I think you've also made the attribute annotative. You must only make the block annotatative, not the attribute!

If you have also made the attribute annotative it will scale twice (=quadratic): with the block and on it's own.

 

 

I verified the block and the attributes are not annotative just the block is.

Link to comment
Share on other sites

One thing I did notice is that if the anno scale is 1:1 it works correctly but if it is any other anno scale not so much.

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