Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp to multi scale separate base point.

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
Anonymous
1941 Views, 18 Replies

lisp to multi scale separate base point.

Hi.

I hope any one can help me.

 

I am finding lisp for multiple scale lisp, I need to change Mtext & Block need to be scaled same location. 

Scale for 50 to 75.

Kindly advise me. 

 

Thanks in advance..

Sujinkutti. 

18 REPLIES 18
Message 2 of 19
jayhar
in reply to: Anonymous

Hi,

Here the location for you searching. Visual LISP, AutoLISP and General Customization click here

 

 

 

 

Please Subscribe YouTube Channel
https://www.youtube.com/channel/UCclj8v9vHQiFa8_DriuAk3w

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly.
Message 3 of 19
Anonymous
in reply to: jayhar

Hi..

This link not working. its seems like this below snap please advice.

 

Image.png

Thanks for the reply..

sujinkutti.

Message 4 of 19
jayhar
in reply to: Anonymous

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130

Please Subscribe YouTube Channel
https://www.youtube.com/channel/UCclj8v9vHQiFa8_DriuAk3w

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly.
Message 5 of 19
pendean
in reply to: Anonymous

Message 6 of 19
braudpat
in reply to: pendean

Hello from France

 

I often have to re-scale or to re-rotate Blocs & Texts/MTexts

but relative to their insertion point !

 

So I am using since a long time ago these 2 routines ...

 

- TXROT / TXSCA : Text Rotation & Scale

 

- BROT / BSCA : Block Rotation & Scale

 

Regards, Patrice (The Old French EE Froggy)

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 7 of 19
Anonymous
in reply to: braudpat

Hi..

 

First of all thank you very much of your response.

You are great!!!

I"m very happy to using this lisp. 

 

Thanks and regards,

Sujinkutti.

 

Message 8 of 19
Anonymous
in reply to: Anonymous

Hi..

I hope any one can modified this lisp..

Above lisp is separately i trying to combine but that's asking separate selection.

I need to change scale block and Mtext select one time with one commend.

 

Please refer the lisp formula for you modification.

 

 

(defun c:btsc (/ *error* doc scl ss)

(vl-load-com)

(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(defun *error* (msg)
(or (= msg "Fonction annulee")
(princ (strcat "Erreur: " msg))
)
(vla-EndUndoMark doc)
(princ)
)
(if
(and
(setq scl (getreal "\nFacteur d Echelle (Scale Factor) : "))
(ssget '((0 . "INSERT")))
)
(progn
(vla-StartUndoMark doc)
(vlax-for o (setq ss (vla-get-ActiveSelectionSet doc))
(foreach p '(XScaleFactor YScaleFactor ZScaleFactor)
(vl-catch-all-apply
'(lambda ()
(vlax-put-property o p (* scl (vlax-get-property o p)))
)
)
)
)
(vla-delete ss)
(vla-EndUndoMark doc)
)
)
(princ)




(if (setq ss (ssget "_:L" '((0 . "TEXT,MTEXT"))))
(progn
(setq ass (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))
ss nil

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
rot (getreal "\nFacteur d Echelle (Scale Factor > 0): ")
;;; rot (getangle "\nAngle de rotation: ")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

)
(vlax-for text ass

;;;;;;;;;;;;;;;;;;; Rotation --> Height ;;;;;;;;;;;;;;;;;;;;;;;;;;
(vla-put-Height text (* rot (vla-get-Height text)))
;;; (vla-put-Rotation text (+ rot (vla-get-Rotation text)))

)
(vla-delete ass)
) ; progn
) ; if ss
(princ)
)

 

 

I hope nothing is impossible with any one. 

 

Thanks in advance,

Sujinkutti.

Message 9 of 19
braudpat
in reply to: Anonymous

Hello

But you can do a selection with BROT or BSCA and action ...

Then you launch TXROT or TXSCA and at the "Selection question" you type
P <Enter> <Enter>

Maybe I don't undertstand your problem !?

 

Or do you want ONE question only and then Scale or Rotate ALL (= Blocks + Texts + MTexts) ??


Regards, Patrice


Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 10 of 19
Anonymous
in reply to: braudpat

Hi..

Sorry for the inconvenience..

 

I have to change scale Block and Mtext with one comment..

you given lisp lisp nice But, that's using separate command. I need one command both will have to changed.

 

Thank you.

Sujinkutti.

 

Message 11 of 19
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... 

I have to change scale Block and Mtext with one comment..

you given lisp lisp nice But, that's using separate command. I need one command both will have to changed.

....


 

It's not really necessary to handle Blocks and Text/Mtext differently, and deal with X and Y and Z scale factors separately for Blocks.  The differentiation does need to account for the fact that the insertion point is dealt with differently for other-than-left-justified plain Text than for Blocks/Xrefs and left-justified Text.  Try this combined commmand:

 

(defun C:SBTI (/ sf ss n ent); = Scale Blocks/Xrefs & Text/Mtext about Insertion points
  (initget 6); no zero, no negative
  (setq sf (getreal "\nScale factor for all selected Blocks/Xrefs/{M}Text: "))
  (if (setq ss (ssget "_:L" '((0 . "INSERT,*TEXT"))))
    (repeat (setq n (sslength ss))
      (setq
        ent (ssname ss (setq n (1- n)))
        edata (entget ent)
      ); setq
      (command "_.scale" ent "" "_none"
        (cdr ; insertion point
          (assoc
            (if
              (and ; other-than-left-justified Text only
                (member '(0 . "TEXT") edata)
                (not (= (cdr (assoc 72 edata)) (cdr (assoc 72 edata)) 0))
              ); and
              11 ; then -- ins. pt code for Text other than left-justified
              10 ; else -- ins. pt code for left-justified Text, Mtext & Blocks/Xrefs
            ); if
            edata
          ); assoc
        ); cdr
        sf
      ); command
    ); repeat
  ); if
  (princ)
); defun

It could also be done using VLA properties, with the InsertionPoint and TextAlignmentPoint properties needing the same kind of distinction as the (assoc 10) vs. (assoc 11) entity-data entries.

 

Kent Cooper, AIA
Message 12 of 19
Anonymous
in reply to: Kent1Cooper

Hi..

 

It's working, Thank you very much for giving this lisp..

It's very useful for me...

 

Thanks a lot!!!!

Sujinkutti.. 

Message 13 of 19
prash1730
in reply to: Kent1Cooper

Namaste,

@Kent1Cooper thank you for the lisp. It is scaling the text at its insertion point. 

Is there a way to scale the bubble attribute encircling the text?

 

BR,

PNP

Message 14 of 19
Kent1Cooper
in reply to: prash1730


@prash1730 wrote:

....  Is there a way to scale the bubble attribute encircling the text? ....


Tell us more about what the "bubble attribute" is.  Are you talking about a Text Frame on Mtext [which is a part of the Mtext itself]?  Or the result of using TEXTMASK on Text or Mtext [which gets made into a Group with it]?  Or something else?

Kent Cooper, AIA
Message 15 of 19
Sea-Haven
in reply to: Anonymous

Is it like this problem where number is bigger than circle object in block.

SeaHaven_0-1716275833087.png

 

Post a dwg.

Message 16 of 19
prash1730
in reply to: Kent1Cooper

Namaste,

Thanks a lot for your reply @Kent1Cooper and @Sea-Haven 

PFA dwg. for your ref. I want to increase the size of the bubble along with the text size inside it. If i scale it using SC with basepoint, then the position of the bubble will get changed.

 

I am looking for a routine to increase bubble and text size at their current location.

BR,

PNP

Tags (2)
Message 17 of 19
Kent1Cooper
in reply to: prash1730

The center point of a Circle is held in the same entity data entry as the insertion point of most of those other possible object types.  So try changing this line in Message 11:

(if (setq ss (ssget "_:L" '((0 . "INSERT,*TEXT"))))

to this, to also accept selection of Circles:

(if (setq ss (ssget "_:L" '((0 . "INSERT,*TEXT,CIRCLE"))))

If that does it for you, change the prompt and comments that reference possible object types.

 

Or, use the SAC command in ScaleAboutCenters.lsp, >here<.  Then it won't matter if the Text is not Middle or Middle-Center justified, and its insertion point isn't in the center of the Circle -- it will be Scaled around the midpoint of its extents, rather than around its insertion point.

Kent Cooper, AIA
Message 18 of 19
Sea-Haven
in reply to: Anonymous

This may be useful makes a block with attribute in a circle or sq supports A-Z or 1 2 3 etc.

SeaHaven_0-1716339999201.png

 

Message 19 of 19
prash1730
in reply to: Kent1Cooper

Namaste,

Thank you @Kent1Cooper SAC is working for me!

Thank you for your help @Kent1Cooper and @Sea-Haven 🙏🙏

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report