PDA

View Full Version : Problem with trying to set a civil 3d setting



ccalder
2014-08-27, 08:49 PM
So I might be jumping in over my head here, but I have a minority of users (3 out 70) that dislike the event viewer in civil 3d and disable it in their drawings. Not enough of the user base to justify changing the setting in our templates but I see no harm letting those turn off that particular vista (its a drawing specific setting). Anyways I was hoping to automate it for them but I'm running into a snag. Here's a snippet



(setq acadObject (vlax-get-acad-object))
(setq C3D (vla-getinterfaceobject acadObject "AeccXUiLand.AeccApplication.10.4"))
(setq c3ddoc (vla-get-activedocument c3d))
(setq c3dsettings (vla-get-settings c3ddoc))
(setq c3dgeneral (vla-get-generalsettings c3dsettings))
(setq settings (vlax-get-property c3dsettings 'generalsettings))
(setq amb (vlax-get-property settings 'ambientsettings))
(setq gen (vlax-get-property amb 'generalsettings))
(setq evtview (vlax-get-property gen 'showeventviewer))
(vlax-put-property evtview 'value :vlax-false)
; error: Automation Error. This property is read only


the object saved to evtview shows several values that change if I use the dialogue boxes in the toolspace pallet but I can't seem to set the properties through vlisp code. I'm probably taking a wrong turn somewhere. Does anyone have any insight into my problem here?

BlackBox
2014-08-27, 09:05 PM
As you've found out, many C3D Properties are not fully exposed, even if you can access them.

That said, you can write a small .NET app which can call the HIDEEVENTVIEWER Command from within an Event Handler (reactor), as you cannot call Commands in a Visual LISP Reactor... That of course, if you didn't just modify the appropriate Property from Civil 3D .NET API.

I may be missing another simple solution; it's been a long, l o n g day here.

HTH

ccalder
2014-08-27, 09:11 PM
lol, this is just more proof that I need to find the time to learn .net. I kinda suspected it was something along those lines with this one. Thanks anyways.

ccalder
2014-08-28, 02:23 PM
if anyone is curious, the guy who asked me to change our company template to begin with did his own post on another forum and got an answer

http://forums.autodesk.com/t5/autocad-civil-3d-customization/event-viewer/td-p/5238115

apparently I DID take a wrong turn, I went to ambient settings through generalsettings, instead of drawingsettings. the fact that it is a drawing specific setting should have tipped me off I guess.

BlackBox
2014-08-28, 02:41 PM
if anyone is curious, the guy who asked me to change our company template to begin with did his own post on another forum and got an answer

http://forums.autodesk.com/t5/autocad-civil-3d-customization/event-viewer/td-p/5238115

apparently I DID take a wrong turn, I went to ambient settings through generalsettings, instead of drawingsettings. the fact that it is a drawing specific setting should have tipped me off I guess.

I overlooked that observation as well; Jeff is my hero... Glad you got it sorted. :beer: