Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/10/2023 in all areas

  1. I'm writing the complete code just in case it's useful for someone Sub MoveEntities() On Error Resume Next Dim doc As Object Dim db As Object Dim modelspace As Object Dim entity As Object Dim basePoint(2) As Double Dim displacement(2) As Double Set doc = ThisDrawing Set db = doc.Database Set modelspace = db.modelspace basePoint(0) = 0 ' X basePoint(1) = 0 ' Y basePoint(2) = 0 ' Z displacement(0) = 300 ' deltaX is changable displacement(1) = 500 ' deltaY is changable displacement(2) = 0 'deltaZ is changable For Each entity In modelspace If entity.ObjectName = "AcDbLine" Or entity.ObjectName = "AcDbCircle" Then entity.Move basePoint, displacement End If Next entity doc.SendCommand "_regen" & vbCr Set doc = Nothing Set db = Nothing Set modelspace = Nothing Set entity = Nothing End Sub
    2 points
  2. Sorry, unfortunately I don’t have VBA It looks like you’re really close though. It looks like to me you’re working with the wrong document. You need to be working with the model space from the document you just opened Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime
    2 points
  3. This is Python, but it's ActiveX, so you should be able to follow along #AXDBLib.AxDbDocument def PyRxCmd_doit(): try: dbx = AxUt.getDbx() dbx.Open("e:\\example.dwg") minpt = (99999,99999,99999) ent : Ax.IAcadEntity for ent in dbx.ModelSpace: minmax = ent.GetBoundingBox(None,None) minpt = min(minmax[0],minpt) for ent in dbx.ModelSpace: ent.Move(minpt,(0,0,0)) dbx.SaveAs("e:\\example2.dwg") except Exception as err: traceback.print_exception(err)
    2 points
  4. It has limits, so it is something that needs clarified. Also, you show AutoCAD LT 2023 in your profile.
    1 point
  5. Thank you all for your inputs. Working solution is available here. https://www.theswamp.org/index.php?topic=58623.0
    1 point
  6. Dear Emmanuel Delay Thanks a lot... This really works well with option 2. Thanks a lot again.
    1 point
  7. Are you looking for this its step 1 of auto making layouts. Yes can rotate the rectangs. Draw rectangs.mp4
    1 point
  8. I am with BigAl here, most plotters will have discrete sizes as a default, European ae 'A' sizes for example A1, A2, A3 and so on, and it is most convenient to use them. For PDFs I'd assume that these are generated to send outside of your organisation, to a customer or client, and here, they will usually prefer a standard paper size - if they print the PDF onto paper odd paper sizes might get corrected to give strange scales and even distortions. So my thought would be to ask can you alter your thinking about a bit so that you plot by default to the standard paper sizes, using your scale factor to select the most suitable paper to fit your drawing?
    1 point
×
×
  • Create New...