- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- AutoCAD MAP / CIVIL -
Excuse my inexperience in lisp, but I'm hoping one of the more wise among you might be able to help me out.
I'm working on a routine where a bunch of mpolygons with OD were imported as polylines, so that their boundaries could easily be edited and changed.
In an other routine all those polylines are sorted in different layers based on their KEY value in the OD, from which per layer we try to turn them back into MPOLYGONS and attach the OD data from the polylines back to the MPOLYGON.
Now at a certain point in the routine we use the following code to make the MPOLYGONS
(command "_mpolygon" "_S" tmpss "") ; make a mpolygon of all objects in the current ss
(command) ; empty command to produce an ESC to quit the MPOLYGON command
The problem is that everything works well, except that if I have 3 polylines in my ss, the mpolygon command will create 3 mpolygons (with the correct 2 inner islands) instead of 1 mpolygon (with the correct 2 inner islands). And so on... depending on the number of items in my SS, that amount of mpolygons will be created, while the whole point is that only a single mpolygon is created per layer.
If you run the command manually in AutoCAD with the same items as in the ss, it works correctly and only generates a single mpolygon with the correct islands/multi-geometry.
Do you guys know of any way to avoid this, rather than trying to add a 'find and delete duplicates' to the routine. (We are talking about 2000+ mpolygons that need to be created per project)
Maybe there is an easier way to turn a ss of closed polylines into a single mpolygon with some of the vlax- commands?
I didn't find any help from the AutoLISP or ade_function catalogs.
Thank you for your time ...
Solved! Go to Solution.