Are you trying to insert and no matter what angle you put the block at the attribute in the block or outside of it will always me at 0? How are you inserting the blocks?

Registered forum members do not see this ad.
Attached is a dwg of a bunch of 2 x 4 lights with three attributes...
What I want to know is - could it be possible to automate the rotation of these attributes as I have them shown.
The problem is, depending on the roration angle of the inserted block, the insertion points of the attributes will change.
I have a routine that will rotate all atributes horizontal - but it does not change the insertion points....
Code:(defun C:2ft_x_4ft ( ) (setvar "cmdecho" 0) (setvar "orthomode" 1) (SETVAR "attreq" 0) (setq ds (getvar "dimscale")) (setq ip (getpoint "Insertion Point:")) (setq clay (getvar "clayer")) (command "-layer" "s" "E-LITE-CLNG-NEW" "") (command "insert" "2ft_x_4ft" ip ds "" pause) (SETVAR "attreq" 1) (SETQ ENT (entlast)) (SETQ NXT (ENTNEXT ENT)) (IF (/= NXT nil) (progn (SETQ VAR (ENTGET NXT)) (WHILE (= (CDR (ASSOC 0 VAR)) "ATTRIB") (SETQ VAR (SUBST '(50 . 0.0) (ASSOC 50 VAR) VAR)) (ENTMOD VAR) (ENTUPD ENT) (SETQ NXT (ENTNEXT NXT)) (SETQ VAR (ENTGET NXT)) ) ) ) (SETVAR "attreq" 1) (setvar "clayer" clay) (princ) )
ATRIBS.dwg
I'm sure something like this has been done in the past - can anyone help out?
mhamilton5@neo.rr.com
Are you trying to insert and no matter what angle you put the block at the attribute in the block or outside of it will always me at 0? How are you inserting the blocks?

Yes - no matter what angle I insert the block the text will be horizontal (rotation angle = zero)... but the trick is to get the insertion points of the attributes to move. I am inserting by clicking on an icon that runs the above listed routine.
Matt murphy from Augi did a great job of explaning just that problem.
This is from some notes;
"Under Attribute definition, check or uncheck the Lock position in block according to what results you are looking for"
I believe (if my memory serves me correctly) that this can all
be done through the block/attribute editor.
Hope that helps

Matt,
I want all this attribute moving stuff to happen automatically upon inserting a block. I do not want it to be a manual process. Select teh icon to insert a particular block... depending on the rotation angle the attributes reposition themselves to a standard. Then weh the user actually enters data into the attribute - the text will be preformattted to the standard.
- mark




Have you thought about two blocks ?
Then you can always apply a rule to the text position.

Yes - but I would need 360 blocks. one for each angle - I just thought coding it would be cooler and more neat.
I have alterate one of my routines for this purpose:
Find also AMOVE program to move multiple attributes in multiple blocks.Code:(defun c:anor(/ blSet attLst errCount minPt maxPt mPt xPt nPt cX) (princ "<<< Select blocks with attributes >>>") (setq errCount 0) (if (setq blSet(ssget '((0 . "INSERT")(66 . 1)))) (progn (setq blSet(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex blSet))))) (foreach itm blSet (setq attLst (vlax-safearray->list (vlax-variant-value (vla-GetAttributes itm)))) (foreach att attLst (if(vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Rotation(list att 0))) (setq errCount(1+ ErrCount)) ); end if ); end foreach (vla-GetBoundingBox(car attLst) 'minPt 'maxPt) (setq cX (car (vlax-safearray->list minPt))) (foreach att attLst (vla-GetBoundingBox att 'mPt 'xPt) (setq nPt(vlax-3D-point (list cX (cadr (vlax-safearray->list mPt)) 0.0))) (if(vl-catch-all-error-p (vl-catch-all-apply 'vla-Move(list att mPt nPt))) nil ); end if ); end foreach ); end foreach ); end progn (princ ">>> Nothing selected! <<<") ); end if (if(/= 0 errCount) (princ (strcat ">>> " (itoa errCount) " were on locked layers! <<< ")) ); end if (princ) ); end of c:anor

Registered forum members do not see this ad.
Ok, there is little problem. I will correct it.
Bookmarks