I am in need of a small Lisp Program that will scale up and object

I am in need of a small Lisp Program that will scale up and object

perezjavier21294
Observer Observer
500 Views
5 Replies
Message 1 of 6

I am in need of a small Lisp Program that will scale up and object

perezjavier21294
Observer
Observer

Hello all

I am in the hope that someone can help me with this. Example: I draw a profile like an angle profile at 1.0 x 1.0 x.125in thickness. I then use the PE command to convert it to one entity, then I scale it up to 1.016.  I would like a lisp program that can scale a profile up with one command and add the text (This profile has been scaled). The scale of 1.016in needs to be incorporated in the code, no prompt to ask what scale factor to use. I am hoping to accomplish this with one click in selecting of the object to be scaled, scale it up and add the text at the pick point.

Thanks in advance to those that can help.

Sincerely

Javier

0 Likes
Accepted solutions (1)
501 Views
5 Replies
Replies (5)
Message 2 of 6

Sea-Haven
Mentor
Mentor

There is plenty of steel shape lisp's out there that will draw angles such as Wiseysteelshapes it has metric and imperial shapes from various parts of the world sounds like what you want a slightly different size angle, there are data files so you can find your shape.

 

Are you trying to do a metric angle 25x25x3 ? A 1" is 25.4mm so scale would be smaller not bigger.

(/ 25.0 25.4) 0.984251968503937

 (/ 25.4 25.) 1.016

 

SeaHaven_0-1644478442259.png

 

0 Likes
Message 3 of 6

ВeekeeCZ
Consultant
Consultant

Better post some dwg that will clearly show your goal.

0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant

@perezjavier21294 wrote:

Hello all

....  I would like a lisp program that can scale a profile up with one command and add the text (This profile has been scaled). .... add the text at the pick point.


That should not be difficult.  What should be the base point to Scale it about?  Should the Text be in whatever happens to be the current Style, or should a Style be built in?  What about Text height -- something constant, or relative to the size of the profile, or....?  Text Layer?

Kent Cooper, AIA
0 Likes
Message 5 of 6

calderg1000
Mentor
Mentor
Accepted solution

Regards @perezjavier21294 

Here something quick with just one click

 

(defun c:SP (/ spm s p)
  (setq
    spm (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
  )
  (setq s (entsel "\nSelect Object: ")
        p (cadr s)
  )
  (vl-cmdf "_.scale" (car s) "" p 1.016)
  (vla-addtext spm "This profile has been scaled" (vlax-3d-point p) 0.2)
  (princ "\nThis profile has been scaled")
  (princ)
)

 

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 6 of 6

perezjavier21294
Observer
Observer

Thank You so much

The program works as intended. 

I like

0 Likes