PCB Libraries Forum Homepage
Forum Home Forum Home > PCB Footprint Expert > Product Suggestions
  New Posts New Posts RSS Feed - Create Footprint Window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Create Footprint Window

 Post Reply Post Reply Page  <123>
Author
Message
chrisa_pcb View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Jul 2012
Location: San Diego
Status: Offline
Points: 772
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisa_pcb Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2015 at 10:42am
Easy enough to drop-in. I'll give it a try. Thanks.
Back to Top
Back to Top
chrisa_pcb View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Jul 2012
Location: San Diego
Status: Offline
Points: 772
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisa_pcb Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2015 at 12:53pm
Originally posted by robmeyer robmeyer wrote:

If you use in your scripts this: Board.LayerStack_V7.LayerObject_V7[ILayer.MechanicalLayer(i)]
You can work with all Layers from 1 to 32 in AD14 and later.
 
Does that return a TLayer object which is then provided to the .Layer of the element being built? I assume the proper terminology from our script would be:
 
CurrentLib.Board.LayerStack_V7.LayerObject_V7[ILayer.MechanicalLayer(i)]
 
as a .Board only exists within CurrentLib.
 
Edit: I tried manual editing to set a track layer per your setup and it doesn't recognize a LayerStack_V7 property.
Back to Top
robmeyer View Drop Down
Advanced User
Advanced User


Joined: 04 Oct 2012
Status: Offline
Points: 113
Post Options Post Options   Thanks (0) Thanks(0)   Quote robmeyer Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2015 at 2:24am
This LayerObject things are taken from the attached script. This script is used to manipulate the Designator on the Layer you want.
uploads/870/AdjustDesignators2.zip

With this code inserted in your produced script, I could enable and show MechLayer17:
   Stack      : IPCB_LayerStack_V7;
   Board       : IPCB_Board;

Begin
    NewPCBLibComp := PCBServer.CreatePCBLibComp;
    NewPcbLibComp.Name := 'RESCAXS50P200X100X55-8L';
    NewPCBLibComp.Description := 'Chip Array, 2 Side Convex, 0.50 mm pitch;8 pin,2.00 mm L X 1.00 mm W X 0.55 mm H body';
    NewPCBLibComp.Height := MMsToCoord(0.55);
     Board := PCBServer.GetCurrentPCBBoard;
     Stack := Board.LayerStack_V7;

    Stack.LayerObject_V7(ILayer.MechanicalLayer(17)).SetState_MechLayerEnabled := true;
    Stack.LayerObject_V7(ILayer.MechanicalLayer(17)).IsDisplayed[Board] := true;
    Board.ViewManager_FullUpdate;
    Board.ViewManager_UpdateLayerTabs;


Now is "only" the question how to draw on this layer.

Did you have Altium installed to get these things tested?
Back to Top
chrisa_pcb View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Jul 2012
Location: San Diego
Status: Offline
Points: 772
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisa_pcb Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2015 at 10:46am
Originally posted by robmeyer robmeyer wrote:

This LayerObject things are taken from the attached script. This script is used to manipulate the Designator on the Layer you want.
uploads/870/AdjustDesignators2.zip

With this code inserted in your produced script, I could enable and show MechLayer17:
   Stack      : IPCB_LayerStack_V7;
   Board       : IPCB_Board;

Begin
    NewPCBLibComp := PCBServer.CreatePCBLibComp;
    NewPcbLibComp.Name := 'RESCAXS50P200X100X55-8L';
    NewPCBLibComp.Description := 'Chip Array, 2 Side Convex, 0.50 mm pitch;8 pin,2.00 mm L X 1.00 mm W X 0.55 mm H body';
    NewPCBLibComp.Height := MMsToCoord(0.55);
     Board := PCBServer.GetCurrentPCBBoard;
     Stack := Board.LayerStack_V7;

    Stack.LayerObject_V7(ILayer.MechanicalLayer(17)).SetState_MechLayerEnabled := true;
    Stack.LayerObject_V7(ILayer.MechanicalLayer(17)).IsDisplayed[Board] := true;
    Board.ViewManager_FullUpdate;
    Board.ViewManager_UpdateLayerTabs;


Now is "only" the question how to draw on this layer.

Did you have Altium installed to get these things tested?
 
I do have Altium installed, yes. Thanks for expanding on this.. I'll test your stuff and see about implementing it.
Back to Top
chrisa_pcb View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Jul 2012
Location: San Diego
Status: Offline
Points: 772
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisa_pcb Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2015 at 12:21pm
Stack := Board.LayerStack_V7;
I get an undeclared identifier for LayerStack_V7 when I go to run. It simply doesn't recognize it as a property of board. Which version of Altium are you using? I'm currently using v13.3. Is this functionality that was added in a more current version of Altium?
 
Back to Top
robmeyer View Drop Down
Advanced User
Advanced User


Joined: 04 Oct 2012
Status: Offline
Points: 113
Post Options Post Options   Thanks (0) Thanks(0)   Quote robmeyer Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2015 at 12:39pm
In AD13 the V7 API is not implemented. It is available since AD14. Could be that it also work with Stack := Board.LayerStack;
Back to Top
chrisa_pcb View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Jul 2012
Location: San Diego
Status: Offline
Points: 772
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisa_pcb Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2015 at 1:18pm
So basically, to do it it needs to use functionality only found in the latest version of the tool? Not a big fan of that, particularly given I have nothing to test it with.
Back to Top
robmeyer View Drop Down
Advanced User
Advanced User


Joined: 04 Oct 2012
Status: Offline
Points: 113
Post Options Post Options   Thanks (0) Thanks(0)   Quote robmeyer Quote  Post ReplyReply Direct Link To This Post Posted: 27 Feb 2015 at 5:40am
I found something, but it is not really nice. You could use something like:

{procedure ReadStringFromIniFile read settings from the ini-file.....................}
function ReadStringFromIniFile(Section,Name:String,FilePath:String,IfEmpty:String):String;
var
  IniFile     : TIniFile;
begin
     result := IfEmpty;
     if FileExists(FilePath) then
     begin
          try
             IniFile := TIniFile.Create(FilePath);

             Result := IniFile.ReadString(Section,Name,IfEmpty);

          finally
                 Inifile.Free;
          end;
     end;

 end;  {ReadFromIniFile end....................................................}

Procedure MechLayer;
Var
    Board       : IPCB_Board;
    MajorADVersion : Integer;

Begin

     Board := PCBServer.GetCurrentPCBBoard;

     //Check AD version for layer stack version
      MajorADVersion := StrToInt(Copy((ReadStringFromIniFile('Preference Location','Build',SpecialFolder_AltiumSystem+'\PrefFolder.ini','14')),0,2));


     if MajorADVersion >= 14 then
     begin
             Board.LayerStack_V7.LayerObject_V7(ILayer.MechanicalLayer(17)).SetState_MechLayerEnabled := true;
             Board.LayerStack_V7.LayerObject_V7(ILayer.MechanicalLayer(17)).IsDisplayed[Board] := true;
     end;

     if MajorADVersion < 14 then
     begin
             Board.LayerStack.LayerObject_V7(ILayer.MechanicalLayer(17)).SetState_MechLayerEnabled := true;
             Board.LayerStack.LayerObject_V7(ILayer.MechanicalLayer(17)).IsDisplayed[Board] := true;
     end;


Maybe you have a good idea how to combine LayerStack and LayerStack_V7. All other things are the same. Then the next problem would be how to place Tracks on these Layers. I think it is to much affort to get this work, for a small usergroup.

If you want to continue I will do what I can.

Robert
Back to Top
Tom H View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Jan 2012
Location: San Diego, CA
Status: Offline
Points: 5716
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tom H Quote  Post ReplyReply Direct Link To This Post Posted: 27 Feb 2015 at 6:24am
Robert,
 
We can do anything, but we are not on Altium yearly maintenance and we do not have V14 or V15 of Altium.
 
We're trying to negotiate a deal with Altium to get a couple of new licenses, but we only need the Library Features. We do not do PCB design work in Altium so we don't need part placement, rules, routing, Out Job, etc. So we're not going to pay $10K per seat for features we'll never use.
 
Stay connected - follow us! X - LinkedIn
Back to Top
robmeyer View Drop Down
Advanced User
Advanced User


Joined: 04 Oct 2012
Status: Offline
Points: 113
Post Options Post Options   Thanks (0) Thanks(0)   Quote robmeyer Quote  Post ReplyReply Direct Link To This Post Posted: 27 Feb 2015 at 6:44am
I understand this complete.

The only question on this topic was if you want to go on and pay time on this. Then I could help a little bit.
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.172 seconds.