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

custom entity inherit from AcDbPolyline can not display without app loaded

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
sdphg
907 Views, 6 Replies

custom entity inherit from AcDbPolyline can not display without app loaded

I have a custom entity inherit from AcDbPolyline,it works fine when the dbx and arx file load.but when you save the file and open it without load those two files,the proxy information dialog show and select show proxy option,the proxy entity didn't show.but when you use CTRL+A to select all,it said the proxy entity has been selected.If I choose to inherit from AcDbEntity,everything is ok.why? 
thanks.

6 REPLIES 6
Message 2 of 7
owenwengerd
in reply to: sdphg

AcDbPolyline does not draw proxy graphics for derived classes, at least in earlier versions of AutoCAD. You can override the AcDbEntity::saveAs() method to draw proxy graphics for your object.

--
Owen Wengerd
ManuSoft
Message 3 of 7
sdphg
in reply to: owenwengerd

thanks owen,that's the reason.

Message 4 of 7
the1russ
in reply to: owenwengerd

what is the AcDbPolyline::saveAs(...) function supposed to do to?  What function is it suppose to call?

 

I tried   saveAs(mode, st)

 

tried    worldDraw(mode)

 

tried    subWorldDraw(mode)

 

I implemented it and still don't see any thing display for AcDbPolyline based custom entities.  Have tried setting the proxygraphics variable to 0, 1, and 2 prior to saving the drawing with no perceptible change.

Message 5 of 7
artc2
in reply to: the1russ

The worldDraw(mode) that you tried should have worked. That's the default implementation at the AcDbEntity level.

Have you checked in the debugger to be sure that your saveAs() implementation is being executed?
Message 6 of 7
the1russ
in reply to: artc2

Thanks for the reply.

 

I did set a break point in the saveAs function and it does get hit.    initially I did not hit the break point but a little research revealed I had proxygraphics=0 so there is no attempt to create proxy metadata.    Something has changed as this is an old app and in the past we never had to do anything special to get proxy entities to display; worlddraw did the work.  Another symptom, only a small fraction of our acdbblock based entities show up as proxies.  I can load drawings saved a couple years and ago and proxies display fine, but any new save and proxies don't show.   Complication at my end is a former programmer did lots of work to our worlddraw code so I can't rule out it being a change at our end. 

 

Another clue, if I display bounding boxes instead of proxy graphics, the boxes are correct.

 

Do you think anything could be discerned by inspecting a working dwg file vs a non-working one? 

 

Thanks again for your time.

Message 7 of 7
artc2
in reply to: the1russ

You might check to see if your programmer added code to look at the AcGiRegenType and is doing special handling for the type kAcGiSaveWorldDrawForProxy.

I doubt that looking at the resulting dwg files would tell you anything other than that proxygraphics are missing on some entities. It sounds more like you need to be looking at what's happening in worldDraw when the problem entities are saving.

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

Post to forums  

”Boost