Jump to content

Script/Polyline problem


Rooster

Recommended Posts

Got a conundrum for anyone feeling clever today:

 

I have a very simple 2D drawing of a building with room outlines, and nothing else. The rooms consist of separate polylines - these are exported as a DWG file from a survey package. The polylines are joined, but looking at the properties AutoCAD thinks they are open. The solution is to explode the polylines and rejoin, after which they all appear as closed. All fine. However, not wanting to manually do this on all my drawings, I wrote a quick script which goes like this:

 

EXPLODE

ALL

PEDIT

M

ALL

 

J

0

 

;END

 

The script works, except that it is only exploding and joining one room/group of polylines at a time - ie, after running it, one of my rooms now shows as closed, but the others are still open. If I run it again, one more room will be closed etc etc. Obviously, I need it to do all rooms/polylines in one go.

 

The weird thing is if I manually enter the exact same commands as my script above, it works perfectly. So why the difference?

Link to comment
Share on other sites

Just an update for anyone that's interested.... I've got round this problem by altering my script to the following:

 

_AI_SELALL

XPLODE

G

E

PEDIT

M

ALL

 

J

0

 

;END

 

Seems that it now works when selecting the polylines before exploding. Still doesn't explain why the previous one worked manually but not as a script.

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...