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

Because it does not work

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
adaptacad
844 Views, 6 Replies

Because it does not work

Hello everyone, I have a file with several points and I would like to increase the scale of all.

I attached a Dwg because the LSP does not work?

 

(defun c:DEMO1()
(setq ss (ssget  '((0 . "INSERT")(2 . "PONTO COTADO")))
      ct 0
      sc (getreal "\nScale: "))
  (repeat (sslength ss)
    (setq inspt (cdr (assoc 10 (entget (ssname ss ct)))))
    (command "_.Scale" ss "" inspt sc)
    (setq ct (1+ ct))
    )
  (princ)
  )

 

 

6 REPLIES 6
Message 2 of 7
ВeekeeCZ
in reply to: adaptacad

(command "_.Scale" ss "" inspt sc)
Here has to be (ssname ss ct) instead of ss.
Message 3 of 7
adaptacad
in reply to: ВeekeeCZ

@ВeekeeCZ 

does not work, are you sure that's it?

 

Message 4 of 7
Kent1Cooper
in reply to: adaptacad

It's true that each SCALE command should be doing the one Block under consideration at the time, not the entire selection set.  But the worse problem is that the insertion point of that Block is 7417222.3813 drawing units  (!) away from the center of the Circle in it, and that's the location they're being scaled around, which of course sends them off to outer space.  You need to redefine the Block so its insertion point is at the center of that Circle [and MOVE all of them accordingly].

Kent Cooper, AIA
Message 5 of 7
adaptacad
in reply to: Kent1Cooper

@Kent1Cooper

But how to do this and quickly?

 

Message 6 of 7
Kent1Cooper
in reply to: adaptacad

You can try a routine to redefine the insertion point of a Block such as >>this<< which claims [I haven't tried it] to keep all insertions where they are, compensating for different scales and rotations.  There are others out there -- that's just one I know where to find.

 

If that doesn't work, here's what I'd do, since they're all at the same scale and at a rotation angle of 0:

 

Draw a temporary LINE from [Osnap INS to] the INSertion point of one of the Blocks to the CENter of its Circle element.  [In the INSert Osnapping, hover your Aperture box over the Circle element, away from any of the Attributes, so it will go to the overall Block's  insertion point.]  Call up REFEDIT and pick that Block.  MOVE all the pieces in it from that end of the temporary Line to the other end of it, that is, from the center of the Circle to the actual insertion point of the Block.  Save the changes.  Then go to the other end of that extremely long Line, and MOVE all those Blocks from that end to the end that's in the area of your other drawn objects.  ERASE the Line.

 

And in the future, never accept the default 0,0,0 in the dialog box for the insertion point when defining a Block!  Always  specify a logical insertion point in relation to the drawn elements.

Kent Cooper, AIA
Message 7 of 7
adaptacad
in reply to: Kent1Cooper

@Kent1Cooper

 

Thanks, it worked yes !!

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report