+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Computer Details
    notredave's Computer Details
    Operating System:
    Vista :(
    Computer:
    HP
    Monitor:
    Dual HP 23"
    Discipline
    Electrical
    notredave's Discipline Details
    Discipline
    Electrical
    Details
    E&I Designer
    Using
    AutoCAD 2009
    Join Date
    Jan 2012
    Location
    Louisiana
    Posts
    24

    Default *HELP* Trying to match block size in x and y axis

    Registered forum members do not see this ad.

    Morning all,

    I am trying to match block on left (2500-RBC) to match block on right (TEST)with x and y axis. I have tried matchblock.lsp with no luck. I have tried changing the properties with no luck. Can someone please help me make the x and y axis match without exploding the block (2500-RBC)?

    Thank you in advance,
    David
    Attached Files

  2. #2
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,088

    Default

    Hi,

    Something like this?
    Code:
    (defun c:matchxy (/ en1 en2)
      (and (setq en1
                  (car
                    (entsel
                      "\nSelect 1st block to move to next block's X & Y :"
                    )
                  )
           )
           (or (= (cdr (assoc 0 (setq en1 (entget en1)))) "INSERT")
               (alert "Invlaid object !")
           )
           (setq en2 (car (entsel "\nSelect 2nd block :")))
           (or (= (cdr (assoc 0 (setq en2 (entget en2)))) "INSERT")
               (alert "Invlaid object !")
           )
           (entmod (subst (assoc 10 en2) (assoc 10 en1) en1))
      )
      (princ)
    )

  3. #3
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    573

    Default

    Are you referring to the size, or matching insertion points like Tharwat did?

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,088

    Default

    But if you are after changing the scale of XYZ then just replace the following line of codes with the one in the above posted codes that I posted earlier.
    Code:
    (entmod (append en1 (list (assoc 41 en2) (assoc 42 en2) (assoc 43 en2))))

  5. #5
    Junior Member
    Computer Details
    notredave's Computer Details
    Operating System:
    Vista :(
    Computer:
    HP
    Monitor:
    Dual HP 23"
    Discipline
    Electrical
    notredave's Discipline Details
    Discipline
    Electrical
    Details
    E&I Designer
    Using
    AutoCAD 2009
    Join Date
    Jan 2012
    Location
    Louisiana
    Posts
    24

    Default

    I am referring to the size to match

  6. #6
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    573

    Default

    With that test drawing, you'd need to grab the size of the bounding box then apply. The two blocks are different sizes at the same scale.

  7. #7
    Junior Member
    Computer Details
    notredave's Computer Details
    Operating System:
    Vista :(
    Computer:
    HP
    Monitor:
    Dual HP 23"
    Discipline
    Electrical
    notredave's Discipline Details
    Discipline
    Electrical
    Details
    E&I Designer
    Using
    AutoCAD 2009
    Join Date
    Jan 2012
    Location
    Louisiana
    Posts
    24

    Default

    Thawart, I tried this appended code you made

    (defun c:matchxy (/ en1 en2)
    (and (setq en1
    (car
    (entsel
    "\nSelect 1st block to move to next block's X & Y :"
    )
    )
    )
    (or (= (cdr (assoc 0 (setq en1 (entget en1)))) "INSERT")
    (alert "Invlaid object !")
    )
    (setq en2 (car (entsel "\nSelect 2nd block :")))
    (or (= (cdr (assoc 0 (setq en2 (entget en2)))) "INSERT")
    (alert "Invlaid object !")
    )
    (entmod (append en1 (list (assoc 41 en2) (assoc 42 en2) (assoc 43 en2))))
    )
    (princ)
    )

    But, when I click on first block (larger one) to match smaller one, it get's larger

  8. #8
    Junior Member
    Computer Details
    notredave's Computer Details
    Operating System:
    Vista :(
    Computer:
    HP
    Monitor:
    Dual HP 23"
    Discipline
    Electrical
    notredave's Discipline Details
    Discipline
    Electrical
    Details
    E&I Designer
    Using
    AutoCAD 2009
    Join Date
    Jan 2012
    Location
    Louisiana
    Posts
    24

    Default

    ronjonp, could you please explain to me on how to do that (grabbing the side of the bounding box and apply)? That is new to me. Thank you!

  9. #9
    Super Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2014
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    1,233

    Default

    Do you need a code, or just that DWG... If the second, I'll attach it to you... It's fairly simple to reset RS-2500 block to scale 1,1,1 and then to recalculate what is each X,Y scale factor according to dimensions of your TEST block...
    Attached Files

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  10. #10
    Junior Member
    Computer Details
    notredave's Computer Details
    Operating System:
    Vista :(
    Computer:
    HP
    Monitor:
    Dual HP 23"
    Discipline
    Electrical
    notredave's Discipline Details
    Discipline
    Electrical
    Details
    E&I Designer
    Using
    AutoCAD 2009
    Join Date
    Jan 2012
    Location
    Louisiana
    Posts
    24

    Default

    Registered forum members do not see this ad.

    marko_ribar, thank you! If you have a code that does that, I will gladly take and use it on others I have to scale. Thank you and thanks to all who replied. I really appreciate it!

Similar Threads

  1. Title Block Size Relative to Sheet Size
    By MahReda in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 21st Nov 2017, 01:31 am
  2. MultiLeader (Block) Match
    By hkncdrc in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 4th Aug 2016, 08:53 am
  3. Design Form size does not match run Form Size.
    By muck in forum .NET, ObjectARX & VBA
    Replies: 0
    Last Post: 13th Aug 2015, 07:14 pm
  4. Block names don't match block resource name?
    By WindowsIHateYou in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 8th Aug 2014, 08:48 pm
  5. How to match Hidden line scale in a block and out of the block
    By gururajendrak in forum AutoCAD General
    Replies: 1
    Last Post: 25th Jun 2009, 04:40 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts