Author Topic: Find and Explode proxy objects  (Read 6150 times)

0 Members and 1 Guest are viewing this topic.

AngelKostadinov

  • Newt
  • Posts: 30
Find and Explode proxy objects
« on: July 28, 2015, 11:46:07 AM »
Hello guys,

I'm using AutoCAD 2016 and I'm batch processing files for our customers. Currently I'm working on ~200 files that contains proxy objects created from 3rd party library (SYSCAD). Our customer wants to remove all proxy objects and to leave more simple objects on their places. I have to remove proxies without changing graphical information of the drawings.
That's why I'm trying to accomplish the following task:
- Open a dwg file;
- Find all proxy objects in all layouts (including model space);
- Explode them to primitive objects;
- Save the file;
Keep in mind, that I have SYSCAD enabler dbx file.
Here is what frustrated me:
- If I open the file without loading the enabler and iterate through layouts, I could take all objects which are from ProxyEntity type, but if I explode them, the objects that left don't look exactly as exploded proxy object;
- If I open the file with enabler loaded into AutoCAD, then many of proxy objects are taken as Polylines or Lines or block Refs but not as ProxyEntity.

What is the valid criteria that I could use to identify which objects are proxies?

Please see attached pics-> On the first, the objects is a Polyline, because enabler is loaded and AutoCAD knows how to handle this object. And on the other hand, on the second picture, you can see  that, when enabler is NOT loaded, it says that the object is a Proxy.

How to identify, when I'm iterating through layouts, which object is a true polyline and which is a proxy but "understand" from Autocad as polyline?

Thank you!

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Find and Explode proxy objects
« Reply #1 on: July 28, 2015, 09:12:16 PM »
You can check the RX class name.

AngelKostadinov

  • Newt
  • Posts: 30
Re: Find and Explode proxy objects
« Reply #2 on: July 29, 2015, 04:10:56 AM »
Thanks, Owen!
I saw that RX class name differs. I know that all proxy objects are zombies, but I am not sure if all "recognized" proxies wear a different name than the objects to which they are likened to.
In the case above, the object is recognized as a polyline and its RX class name is not a AcDbPolyline, but can I be sure that this is always true.

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Find and Explode proxy objects
« Reply #3 on: July 29, 2015, 10:37:34 AM »
Gile has a zombie purge method floating around somewhere I thought.

AngelKostadinov

  • Newt
  • Posts: 30
Re: Find and Explode proxy objects
« Reply #4 on: July 30, 2015, 04:03:05 AM »
Yes, I saw it, but he iterates through all objects in a very funny manner and checks rxClass. Since I have activator the rxclass is not a zombie. I want to find a rule of a thumb, how to differ the objects that are created from SYSCAD, from those, that are native.

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Find and Explode proxy objects
« Reply #5 on: July 30, 2015, 04:02:59 PM »
From C++ you could check the app name for each RX Class, but I don't know if you can do that from .NET. If they register their classes for demand-loading, you can comb through their demand-load registry keys and collect a list of RX class names into a static list that you can hard-code.