cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Using VB to change the color of a surface

ptc-2032585
1-Visitor

Using VB to change the color of a surface

Hope this hasn't been covered...I found lots of toolkit but no VB.


Is it possible to change the color of a surface using VB/VBA?


I've (I think) managed to "get hold" on the surfaces using this:


Private Function GetSurfaces(ByRef model As IpfcModel)
Dim surfaces As IpfcModelItems
Dim numSurfaces As Double

End Function



Thanks in advance.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 REPLY 1

There is no API function in VB or Weblink. Available in Toolkit only.


Perhaps you might try this:


Add all your surfaces to the SelectionBuffer with IpfcSelectionBuffer.AddSelection().


Then run a macro/mapkey with session.RunMacro().


You might have colors defined in your environment and these colors have a NAME, for example "r1", so this mapkey executed after adding surface selections to the selection buffer willassignthe color r1 to the surfaces:


mapkey _sc ~ Select `main_dlg_cur` `ProCmdViewGallery.view`;\
mapkey(continued) ~ Select `main_dlg_cur` \
mapkey(continued) `ProCmdViewGallery_layoutph.palette_holder.myAppPalette.NamesList`1 `r1`;\
mapkey(continued) ~ Timer `UI Desktop` `UI Desktop` `Gallery_UI_Timer`;\
mapkey(continued) ~ Close `main_dlg_cur` `ProCmdViewGallery.view`;



Hope this helps.


Andreas


__________________________________


Andreas Hellmann
MCAD Services Pro/E & Pro/E customization
Am Wartfeld 7
D-61169 Friedberg


phone: +49 151 21259910
mail: -

Announcements


Top Tags