AnsweredAssumed Answered

xPCB rearrange silcscreens Ref Des on PCB

Question asked by kali44 on Jun 15, 2017
Latest reply on Jul 24, 2020 by kali44


i am trying to develop application in c#, for rearrange silcscreens on TOP and BOTTOM of PCB.


Basically it should be similair to this:

Assembly and Silkscreen Ref Des rearrange


I just need iterate through all components and slightly modify their silcs based upon some rules.

But i can't do that.  I read a lot of articles here about automation here in xPCB. BUt still i can't reach my goal.


I am using the template which i found here. I think it was developed by user Pattrick Cashman.


in C# I can't load all silkscreen like this:


Dim fabLayerTexts As MGCPCB.FabricationLayerTexts  
fabLayerTexts = pcbDoc.FabricationLayerTexts(MGCPCB.EPcbFabricationType.epcbFabSilkscreen, MGCPCB.EPcbSelectionType.epcbSelectAll, MGCPCB.EPcbSide.epcbSideTopOrBottom, True)  


And i can't do set their properties.

I am also reading PCB Automation reference now, there is note that FabricationLayerTexts is property of Component object. But in this reference is it handled with that like with method i think. This is also error which i get in Visual Studio.


I can read components form PCB and for example read some of their properties, but still i am not able to edit their silcs.


cmps = (MGCPCB.Components)pcbdoc.Components;
cmp = cmps[1];
double x = cmp.AssemblyOriginX;
double y = cmp.AssemblyOriginY;


thank you for any help.