TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MUQTAR on December 21, 2011, 05:31:02 AM

Title: Align To Rectagles
Post by: MUQTAR on December 21, 2011, 05:31:02 AM
HI,

i have 2 rectangles 1st one dim: 1250mm(w) x 1100mm(L) and 2nd Dim: 1500mm(w) x 1100mm(L)
my problem is when i m trying to align this two object is not aligned well , actually i want to fix 1 object to 2 object why
if any one knows this please tell me how is possible

these are two objects
(http://www.imagehost.tollytorrents.com/images/4jpxdbhcccfaivtwaa.jpg) (http://www.imagehost.tollytorrents.com/)

After Align
(http://www.imagehost.tollytorrents.com/images/h84vtaprgmzvd7us2wfc.jpg) (http://www.imagehost.tollytorrents.com/)
Title: Re: Align To Rectagles
Post by: didier on December 21, 2011, 05:43:35 AM
Coucou

are they both in 2D ?

amicalement
Title: Re: Align To Rectagles
Post by: Coder on December 21, 2011, 05:54:32 AM
Hi

Try the command flatten first and then try to align them .

Thanks
Title: Re: Align To Rectagles
Post by: MUQTAR on December 21, 2011, 06:30:58 AM
Ya they both are in 2d
Title: Re: Align To Rectagles
Post by: CAB on December 21, 2011, 08:34:28 AM
Stating the obvious, The ALIGN command does not work for you?
Title: Re: Align To Rectagles
Post by: MUQTAR on December 21, 2011, 08:44:43 AM
Align is not works,

i need solutions ....
Title: Re: Align To Rectagles
Post by: alanjt on December 21, 2011, 08:50:08 AM
Rotate by reference.  :?
Title: Re: Align To Rectagles
Post by: stevesfr on December 21, 2011, 09:04:42 AM
Rotate by reference.  :?

Rotate command is not intuitive to first time user, however its the way to go.
Title: Re: Align To Rectagles
Post by: MUQTAR on December 21, 2011, 09:07:41 AM
Please Friends Before Reply Try in auto-cad using my dimensions above given,
i try to post image but it's not appearing

thanks for reply,

 
Title: Re: Align To Rectagles
Post by: ronjonp on December 21, 2011, 09:10:27 AM
You can attach your images directly to the post.
Title: Re: Align To Rectagles
Post by: alanjt on December 21, 2011, 09:12:47 AM
Rotate by reference.  :?

Rotate command is not intuitive to first time user, however its the way to go.
I wrote this to make things a little less cumbersome...
Code: [Select]
(defun c:RF (/ ss bp pt)
  (princ "\nSelect object(s) to rotate: ")
  (if (and (setq ss (ssget "_:L"))
           (setq bp (getpoint "\nSpecify base point: "))
           (setq pt (getpoint bp "\nPick point of object to rotate: "))
      )
    (command "_.rotate" ss "" "_non" bp "_r" "_non" bp "_non" pt)
  )
  (princ)
)
Title: Re: Align To Rectagles
Post by: stevesfr on December 21, 2011, 09:31:25 AM
Rotate by reference.  :?

Rotate command is not intuitive to first time user, however its the way to go.
I wrote this to make things a little less cumbersome...
Code: [Select]
(defun c:RF (/ ss bp pt)
  (princ "\nSelect object(s) to rotate: ")
  (if (and (setq ss (ssget "_:L"))
           (setq bp (getpoint "\nSpecify base point: "))
           (setq pt (getpoint bp "\nPick point of object to rotate: "))
      )
    (command "_.rotate" ss "" "_non" bp "_r" "_non" bp "_non" pt)
  )
  (princ)
)

Suggestion: maybe say  "Pick second point of object to rotate:"   
Title: Re: Align To Rectagles
Post by: alanjt on December 21, 2011, 09:32:34 AM
Rotate by reference.  :?

Rotate command is not intuitive to first time user, however its the way to go.
I wrote this to make things a little less cumbersome...
Code: [Select]
(defun c:RF (/ ss bp pt)
  (princ "\nSelect object(s) to rotate: ")
  (if (and (setq ss (ssget "_:L"))
           (setq bp (getpoint "\nSpecify base point: "))
           (setq pt (getpoint bp "\nPick point of object to rotate: "))
      )
    (command "_.rotate" ss "" "_non" bp "_r" "_non" bp "_non" pt)
  )
  (princ)
)

Suggestion: maybe say  "Pick second point of object to rotate:"
Does sound better. TBH, I wrote that macro in 2007 and haven't read the prompts since.
Title: Re: Align To Rectagles
Post by: MUQTAR on December 24, 2011, 09:43:28 AM
Those images of rectangles, 1st one is showing 2 rectangles,
2nd one is after alignment,

check the second one i need to fix them one size after align

is possible if then how,

thanks,

Title: Re: Align To Rectagles
Post by: CAB on December 24, 2011, 10:24:34 AM
I would use the STRETCH command.

Is this a homework assignment?
I see no real world application for what you are doing.