Stefan Bender Posted March 20, 2023 Share Posted March 20, 2023 We frequently need to access the document color table. Atm we do VCOMPtr<VectorWorks::IDocumentColorTable> doccol( VectorWorks::IID_DocumentColorTable ); But that seems to be time-consuming so it would be great to get a handle/pointer to the current document's color table without having to create a new VCOM ptr each time. Is this possible? Thanks for any ideas, Stefan Bender Quote Link to comment
JBenghiat Posted March 20, 2023 Share Posted March 20, 2023 You could always define the ptr in ModuleMain and then initialize if nullptr in the OnInitXProperties events. That's assuming that you don't need to re-initialize if the user makes a change to the color table. Quote Link to comment
Stefan Bender Posted March 23, 2023 Author Share Posted March 23, 2023 Thanks Joshua, I had already thought about something like that, but I'm not sure if the pointer and the data remain valid if the user switches to another document during the session. So I would prefer something that returns the "current" color table of the active document. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.