LISP for handovers to bind then TRIM xrefs

LISP for handovers to bind then TRIM xrefs

barry2104
Collaborator Collaborator
776 Views
2 Replies
Message 1 of 3

LISP for handovers to bind then TRIM xrefs

barry2104
Collaborator
Collaborator

Perhaps there’s something similar out there that can be modified to suit my case, but after a Brief search I couldn't find anything suitable...

I’m looking for ideally a LISP that will do just about all of the following via one command, though steps 1,2,4 & 5 I could do by Hand if need be as they don't take Long - just lisping step 3 would save me numerous hours each month.

 

Lisp Name should be “HANDOVER” and basically from the current .dwg, which has / can have multiple layouts, should carry out the following:

  1. Detach any xrefs which are not currently active (be it turned off or because they can’t be found)
  2. Binds all of the remaining xrefs (with Xref-Name as new Layername-Prefix)
  3. Cropping out unwanted information: This is where the user should be promted whether he wants to restrict the modelspace Information to objects defined by viewport(s) or whether he wants to draw/select a polygon(s) directly from modelspace to have everything outside this polygon trimmed from the drawing...
    →In the Event the user selects the former ("Viewports"), the following steps 1 and 2 Need be applied.
    →In the Event hte user selects the latter ("Modelspace-Polygon"), then he should be prompted to draw (D) a single polygon or select (s) one or even multiple Polygons. This would mean the following steps 1 and 2 would be ignored...:
    1. Create polygons around each of the viewports on each of the layouts (polygon should receive a new layername “ViewportBorder”, which should be a non-print layer), then
    2. Move/transfer all of these polygons from Paperspace(s) to Modelspace.
      .......................
    3. Trim everything that lies outside of the polygons (to cut the .dwg filesize down and to not hand over any unwanted/unnecessary information). This could of course be tricky since all of the original Xrefs are now in Block-form, which could have blocks inside them, etc.
  4. Layer Purge:
    1. removes all layers which are turned off, frozen or have no entities attributed to them after the Xref-Block Trim from step 3 (i.e. deletes all objects which are on frozen/turned-off layers, then purges the layernames)
  5. Saves the drawing as (should be prompted for a new filename/-path, where the User can also choose which .dwg-Version to save as)
Running AutoCAD Architecture 2020, in German
0 Likes
777 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor

Barry hi,

 

have you looked at Export Layout to Model (EXPORTLAYOUT) command?

 

Moshe

 

 

0 Likes
Message 3 of 3

barry2104
Collaborator
Collaborator
I was not aware of this command, however upon testing it, it doesn’t seem to do much of what I want. The first try with a full drawing, one layout, the new/converted .dwg “could not be opened”. Then I tried to just copy out one Xref and a few other local elements from my drawing into a new “Drawing1.dwg” and trying again – this time the converted .dwg could be opened, but the xref/block wasn’t to be found
By the looks of it that command would not be able to trim unwanted stuff for me, which is the crux of my lisp wish

Running AutoCAD Architecture 2020, in German
0 Likes