Inserting UniformScale Block problem

Inserting UniformScale Block problem

WF.Con
Enthusiast Enthusiast
375 Views
4 Replies
Message 1 of 5

Inserting UniformScale Block problem

WF.Con
Enthusiast
Enthusiast

Hi all, and thanks for reading/helping in advance

I've set all my blocks to UniformScale: Yes
However I can't seem to modify my old lisps to insert them correctly.
In the form below, it somehow scales it 10x.
I get to pick the insertion point, then it scales 10x and then I get to pick rotation, and then explodes the block.

i'm pretty sure it has something to do with the  pauze 1 pauze pauze setting 

 

(defun C:FP ( / PHASE_naam choice ss ) 
  (initget 7 "H V") 
  (setq choice (getkword "PHASE <Horizontal, Vertical>: "))   

  ;; Set block name based on choice
  (setq PHASE_naam   
    (cond     
      ((= choice "H") "PHASE_Horizontal")    
      ((= choice "V") "PHASE_Vertical")   
    )  
  )   

  (command "insert" PHASE_naam pause 1 pause pause) 

  ;; Select the last inserted block for explosion
  (setq ss (ssget "L"))  ;; Get the last created object
  (command "explode" ss) ;; Explode the selected block
)

 

 

0 Likes
Accepted solutions (2)
376 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

Blocks are in mm, what units is your drawing in?

 

The code adjusted a little.

 

(defun C:FP ( / choice )
 
  (initget "Horizontal Vertical")
  (if (setq choice (getkword "PHASE [Horizontal/Vertical]: "))
    (command "insert" (strcat "PHASE_" choice) "_s" 1 pause pause
	     "explode" "last"))
  (princ)
  )

 

0 Likes
Message 3 of 5

WF.Con
Enthusiast
Enthusiast

Your code works perfectly...

The blocks were in mm, so was the combined block.
Gues the code got a bit to complicated, thanks for your time!
Been wrestling with this one all day

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

When inserting a block, it's better to call the hidden option (of scale) right away, rather than wait for whether it comes and where. This way, it does not differentiate uniform-scaled blocks from non-uniform ones.

 

(command "_.insert" "blockname" "_scale" 1 ...do the rest....)

0 Likes
Message 5 of 5

WF.Con
Enthusiast
Enthusiast

Thanks for the clarification, definitely going to update my other lisps like that.
Updated all our blocks to "scale uniformly" because I noticed dataextraction always gives an error on misaligned scales.

0 Likes