.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Replacing proxy entities

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
kwFMAAD
1588 Views, 5 Replies

Replacing proxy entities

I've got a file that contains various proxy entities that need to be replaced and I'm trying to write a script to replace them with standard blocks. The problem is I have no idea how they are stored. For autocad to show them properly there must be a database entry somewhere that contains x,y data along with what symbol to show them as.

 

Does anyone know where i can access this and how to iterate over it? I have uploaded a test file with one of the objects.

5 REPLIES 5
Message 2 of 6
norman.yuan
in reply to: kwFMAAD

With Acad .NET API, there is a class Autodesk.AutoCAD.DatabaseServices.ProxyEntity. However, it does not expose the custom entity's geometries as proxy. Just think, a custom entity could be in any shape in terms of geometry: circle, arc, polygon, cube, sphere, long or short line...  How AutoCAD shows as proxy depends on how the developer, who created the custom entity, implement the proxy entities. But the details of this implementation are not exposed to outside in .NET API.

 

I'd say, trying to replace the proxies with something else (blocks, or other entities) might be a bad idea. If the custom entities in drawing matters for the business, you should install the ObjectARX app that creates the custom entities , or get its object enabler installed. If the custom entities are irrelevant to the business, you can turn off the proxy display in AutoCAD.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 6
kwFMAAD
in reply to: kwFMAAD

Oh dear, we dont have access to the original program. Our workaround for many years has been to manually copy our blocks over the top but this is very costly. Is there any other way to read the data from the save file? surely it has to have coordinate data in there somewhere?

Message 4 of 6
norman.yuan
in reply to: kwFMAAD

Since the ProxyEntity class .NET API does not provide the information you wanted, I think using the corresponding ObjectARX app that creates the custom entity is the only option. 

If you export the drawing into DXF format and search the text-formatted DXF file for "AcDbProxyEntity", you may see the proxy's graphics data under group code 310 are binaries, which means it can only be deciphered by the original app, which would be no help to you.

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 6
kwFMAAD
in reply to: kwFMAAD

Fair enough, i think the only way forward would be to selectively exploded them one by one and work out by the remnants which symbol goes where. Thanks for your help.

Message 6 of 6
js75CAD
in reply to: kwFMAAD

I know what you are trying to do and have come across the same problem.

Norman is right, but I found that if I explode the proxy entity, AutoCAD seems to know what is inside it (which is what you and I are looking for), but until you explode it and then iterate each item (which I have to do) then it is impossible.

The way I did it was to write a small routine that breaks down all of the information and from there I can determine the replacement block by the given number and types of entities within the object collection.



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report