How to access active PCB layer information in script file.
If anyone did this then please share me.
The call you are using is supposed to give your the currently active layer (which it does).
To get the number of conductive layer, use docObj.Layercount
Dim Laycnt : Laycnt = docObj.Layercount MsgBox "Number of Conductive Layers : " & Laycnt
It can be got with "pcbDoc.Gui.ActiveRouteLayer".
Dim Laycnt = "pcbDoc.Gui.ActiveRouteLayer" MsgBox("Number of Layer"& Laycnt)
i have written above lines in my script but getting below error
Can you please let me know how to do this ?
Please upload your script for us to take a look at. Also for these tasks take a look at the documentation and maybe even download the AATK (lots of working scripts and good examples in there).
In the above, you do have some syntax errors. Try
Dim Laycnt : Laycnt = pcbDoc.Gui.ActiveRouteLayerMsgBox("Number of Layer"& Laycnt)
Hello Attached script for your reference.
Please check and give me solution
Did you try my suggestion ?
Yes tried but got same error.
Ok, here goes - a couple of mistakes.
I already mentioned the syntax issues in thsis line :
Dim Laycnt = "pcbDoc.Gui.ActiveRouteLayer"
'Gui' is not a method of the Document, but the Application (furthermore, your document object is DocObj, not pcbDoc),
so the full ine should read (I also added spaces to the MsgBox statement, but that's just cosmetics)
Dim Laycnt : Laycnt = app.Gui.ActiveRouteLayer
MsgBox("Number of Layer : "& Laycnt)
DO you tried script with given changes ?
I have tried but getting below error
That is odd - yes, I can run the script successfully. I don't recall making any other changes, but I have attached the script that runs (with VX.2.6)
Did you got all layer count?
iam getting layer count 1, But actually my board is 6 layer.
Yes your suggested lines added and its working.
But it showing only layers which are active, i want all electric layer count
Yes its working
Thanks for your immediate support.
Iam new in scripting if you have some usefull scripts then can you please share it with me so i will get knowledge from your scripts.
I am glad it worked for you !
Well, I suggest you go and fetch the AATK here (AATK ) is a great source of all kinds of examples..
May I ask you to mark the discussion as Helpful ?
yes i will do it....
and also i have downloaded AATK ..
if then also if i will required help then i will raise questions
Retrieving data ...