Jump to content

Urgent - divide a drawing


SCaldeira

Recommended Posts

Dear friends.

I want to know how could using autolisp divide a drawing into equal parts (eg, 9, dividing the drawing in 3x3), 9 DWGs automatically creating a specific folder, and keeping the original coordinates, ie is re-inserted on a new new dwg , to bond perfectly.

Note: no need to trim the division of the drawings. What matters to me is not to lose information. Thanks for the help.

Sorry my bad english.

 

;-)

Link to comment
Share on other sites

I would approach it in the following way:

 

 

  • Get Extents of drawing
  • Prompt for Number of Divisions (must be square integer, otherwise prompt for length of one side)
  • Calculate coordinates for each window
  • Obtain SelectionSet using Window/Crossing selection.
  • WBlock objects in the Selection Set.

 

Here is an example using the same approach to create separate drawings for each layer in a drawing.

 

PS. Labelling your thread as 'Urgent' will not result in a quicker answer, usually such threads are even avoided by most members.

Link to comment
Share on other sites

I understand what you mean. But the urgency is real. In times had a lisp that made it, but my computer broke and I lost the file. If anyone can help me I would be very grateful.

Greetings.

Link to comment
Share on other sites

This will allow you to quickly WBlock a selection:

 

(defun c:wb ( / _uniquefile doc fnm ) (vl-load-com)

   (defun _uniquefile ( seed extn / i file )
       (setq i 0)
       (while (findfile (setq file (strcat seed (itoa (setq i (1+ i))) extn))))
       file
   )
   (setq doc (vla-get-activedocument (vlax-get-acad-object))
         fnm (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) "_")
   )
   (while (ssget)
       (vla-wblock doc (_uniquefile fnm ".dwg") (vla-get-activeselectionset doc))
   )
   (princ)
)

But that's as far as I'm prepared to take it on voluntary time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...