Setting Viewer Background Color results in error
Setting Viewer Background Color results in error
(OP)
Hi Guys,
I have the following code:
Comes up with error: "Compile Error: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic" on the "GetBackgroundColor" and "PutBackgroundColor" code.
I'm not doing this via catscript, but the normal Visual Basic window.
Anyone got any ideas or another solution?
Version V5R18.
Cheers!
I have the following code:
CODE
Dim objViewer3D As Viewer3D
Dim objCamera3D As Camera3D
Set MainDocument = CATIA.ActiveDocument
Set objCamera3D = MainDocument.Cameras.Item(1)
objViewer3D.Viewpoint3D = objCamera3D.Viewpoint3D
Dim DBLBackArray(2)
objViewer3D.GetBackgroundColor DBLBackArray
Dim dblWhiteArray(2)
dblWhiteArray(0) = 1
dblWhiteArray(1) = 1
dblWhiteArray(2) = 1
objViewer3D.PutBackgroundColor dblWhiteArray Comes up with error: "Compile Error: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic" on the "GetBackgroundColor" and "PutBackgroundColor" code.
I'm not doing this via catscript, but the normal Visual Basic window.
Anyone got any ideas or another solution?
Version V5R18.
Cheers!





RE: Setting Viewer Background Color results in error
I suppose you are trying to get a screenshot....should work...
CODE --> vba
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Setting Viewer Background Color results in error
For those who did not notice:
CODE --> vba
Nice
indocti discant et ament meminisse periti
RE: Setting Viewer Background Color results in error
I tried ferdo's code but still my background colour stays in white. Doesnt get back to old color after putbackground colour statement. Am i missing something
Any suggestions
Thanks
Barath
RE: Setting Viewer Background Color results in error
If you don't post your code we cannot see where is failing...is it catscript or catvba or....?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...