Menu

Cannot add new modeld

Help
2016-11-23
2016-11-25
  • Piero Filippin

    Piero Filippin - 2016-11-23

    Hi,
    I am using FreeCAD Windows x64 0.16.6706, latest release of FreeCAD PCB.

    I imported a board from Eagle, I can assign the parts I am using from model_4 library without any problem and link them to the Eagle part numbers I am using but I cannot manage to use a part I downloaded.

    I downloaded a USS type B connector from http://www.tracepartsonline.net/ (WÜRTH ELEKTRONIK - ELECTROMECHANICAL COMPONENTS - COM-Communication Connector - USB - USB 2.0 - Type B), I am confident it is installed properly (proper folder, added to the database, the file is in green etc) but I cannot get it to work, when I click on the "update models"button I get an exception.

    I tried both the iges and step models and a model from a different website (I tried with different objects on different boards and I get the same results), the models work correctly in FreeCAD and I can even import them and align it manually in my board, but if I try with "update model" a new tab is opened (importingPartsPCB1), I see the connector model being loaded but it is never transferred to the tab with the board - I get an error in the report window:

    Exception: Not enough shape objects linked.

    Any help would be appreciated

     

    Last edit: Piero Filippin 2016-11-23
  • Mariusz

    Mariusz - 2016-11-23

    Hi,
    I just test the model and everything works correctly (loading/updating).

    Try version from github.

     
  • Anonymous

    Anonymous - 2016-11-23
     

    Last edit: Anonymous 2016-11-23
  • Piero Filippin

    Piero Filippin - 2016-11-23

    Same behaviour with the Github version. I was also able to reproduce on a colleague's PC.

    This is the model I am loading: model

    It is entirely possible I am setting up the part in the wrong way, or there is something specific to my configuration creating a problem - I have just started using your plugin so I cannot really say "it was working before"

    The only difference I see in the parts included in the models file and the ones I am trying to import is the ones I am trying to import have only a single object in it.

    The error is thrown by freecad itself:

    https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/App/FeaturePartFuse.cpp

    gut feeling is it is trying to merge multiple objects but there is only one object available

    if (s.size() >= 2) {
    [...]
    }
    else {
    throw Base::Exception("Not enough shape objects linked");
    }

     

    Last edit: Piero Filippin 2016-11-23
  • Mariusz

    Mariusz - 2016-11-23

    Hi,
    which model you are using - can you give me link or upload it on sf? This is without difference (should be ;)) if you have one or more "models included" in the file.

    Go to folder where you keep model and check if there is also *.col file - if no, check permissions (script reads model shape from the igs/stp file only at the first time, later shape is taken from col file). Check if you do not have spaces in model path - if yes try without them.

    Copy *.col file to the folder where you keep model (change name to model name). Then try one more time.

     

    Last edit: Mariusz 2016-11-23
  • Piero Filippin

    Piero Filippin - 2016-11-23

    Hi Marius,
    this is the model - WÜRTH ELEKTRONIK - ELECTROMECHANICAL COMPONENTS - COM-Communication Connector - USB - USB 2.0 - Type B

    It is like the one you downloaded (there are 2 models for the B socket in tracepartonline) but on the one I am using the 4 pins are on the bottom and not at the back.


    However it does not matter, every file i tried fails, except for the ones already in the database. The conversion to .col works with all the files in your models and I don't understand what I am doing wrong

    Yes - the .col file is generated but it is "empty":

    2|1464134112.57
    [(0.800000011920929, 0.800000011920929, 0.800000011920929, 0.0)]
    CASCADE Topology V1, (c) Matra-Datavision
    Locations 0
    Curve2ds 0
    Curves 0
    Polygon3D 0
    PolygonOnTriangulations 0
    Surfaces 0
    Triangulations 0
    
    TShapes 0
    
    *
    

    Is there anyway to generate the .col file manually?

     

    Last edit: Piero Filippin 2016-11-24
  • Piero Filippin

    Piero Filippin - 2016-11-23

    Update: I tried with the same model you are using (USB with the pin at the back - IGES version) - same error.

    Exception (Wed Nov 23 23:35:47 2016): Not enough shape objects linked

    I tried using your .col - the conversion is done even if it is present (I see the extra tab appearing) and the .col file is overwritten with the same "empty content". Weird.

    Permission are ok, I followed the manual (even if that step makes sense to me only if your Mod folder is in c:\Program Files), I checked there are no spaces in the path (I had tried that already).

    This is the relevant part in the database:

    [aadhe_71786788]
    datasheet = 
    category = -1
    adjust = {u'Name': [False, u'True', 0.0, 0.0, 0.0, 1.27, (1.0, 1.0, 1.0), u'center'], u'Value': [False, u'True', 0.0, 0.0, 0.0, 1.27, (1.0, 1.0, 1.0), u'center']}
    name = P-USB-TYPEB
    path = tracepartsonline/61400413321
    description = 
    soft = [[u'P-USB-TYPEB-RECEPACLE-THT-LONG', u'Eagle', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]
    add_socket = [False, u'bjhaa_3096386813']
    socket = [False, 0.0]
    

    Thank you very much for trying to help me - I spent two days trying to understand what is going wrong, I reinstalled FreeCad (32 bit, 64 bit, 0.17), reinstalled the plugin, read the manual multiple times etc nothing seems to make a difference.

     

    Last edit: Piero Filippin 2016-11-24
  • Piero Filippin

    Piero Filippin - 2016-11-24

    Update: I just copied a part (heatsink/D01PA.stp) from the models_x.7z into a separate folder, and added is as P-USB-TYPEB-RECEPACLE-THT-LONG - the import is successful!!!

    Of course I get a heatsink in place of the USB port, but this meand I setup parts correctly, permissions are ok etc - but there is something "corrupted" with the models I download from tracepartsonline.

    I just noticed - if I use .stp in place of .igs I get a slightly different error:

    Exception (Thu Nov 24 14:37:58 2016): Fusion failed

    I can reproduce this error by importing the .stp file in FreeCAD, selecting all the parts and goint to the menu parts/boolean/join - which I guess is what the PCB plugin is doing behind the scenes.

     

    Last edit: Piero Filippin 2016-11-24
  • Piero Filippin

    Piero Filippin - 2016-11-24

    One step further:
    the error is generated in PCBpartManaging.py.

    When importing the .stp (which has 7 parts)

    newPart = FreeCAD.ActiveDocument.addObject("Part::MultiFuse","Union").Shapes=fuse

    fails with an exception from FreeCad (which does not seems to trigger a Python exception) "Fusion failed", which is caused by freecad not bein able to merge the components pins with the main body as they don't touch.I get the exact same behaviour by importing the part and trying to fuse them into a single part.

    When importing the .igs (which has 1 part)

    len(fuse)
    evaluates to 0 - which means the
    if len(fuse) == 1:

    is never triggered and
    newPart = FreeCAD.ActiveDocument.addObject("Part::MultiFuse","Union").Shapes=fuse

    triggers the "Not enough shape objects linked" exception (as the fuse array is empty).

    Now the question is - this looks like a problem not with your extension but with FreeCAD itself - why is my bog standard FreeCAD (downloaded the installer from the FreeCAD website) acting different than yours?

     

    Last edit: Piero Filippin 2016-11-24
  • Piero Filippin

    Piero Filippin - 2016-11-25

    Hi,
    I now have my PCB importing correctly.

    However
    * I cannot get .igs import to work on any model. i.isDerivedFrom("Part::Feature") and i.ViewObject.Visibility and len(i.Shape.Solids) always seems to return false on .igs objects

    • .stp work, but the model I was using (the usb with the pins at the bottom) has some kind of error (OCC error when doing part fusion) - and this is a problem with FreeCAD, not the PCB mkodule
     
  • ashofphoenix

    ashofphoenix - 2017-04-11

    Manage to solve that ? got that pb... freecad open the igs file, I try to export it into another igs / step etc., when trying to load that model using PCB-routine an empty col is made anyway and loading fail...

     
  • Mariusz

    Mariusz - 2017-04-11

    Hello,
    did you try version from github - I'm rather sure that I added some solutions/protections. However it is connected directly with FreeCAD (if I remember correctly).

     
  • ashofphoenix

    ashofphoenix - 2017-04-11

    Hi, I will try github version tomorrow. However when I import the IGS model directly onto freecad, It works perfectly ! I dunno a lot about freecad routine to import IGS so atm I got no solution... however it looks like the problem comes from the ".col" transformation. is there a version of PCB without this transformation to check if the problem really comes from that ?

     

    Last edit: ashofphoenix 2017-04-11
  • Mariusz

    Mariusz - 2017-04-11

    Hi,
    load board one more time but uncheck option 'Colorize elements' - version from github will skip col files.

     

    Last edit: Mariusz 2017-04-11
  • ashofphoenix

    ashofphoenix - 2017-04-12

    Hi,
    hint : I confirm that without "color" checked, the components are well loaded. ( any version of PCB )

     

    Last edit: ashofphoenix 2017-04-12
  • ashofphoenix

    ashofphoenix - 2017-04-12

    update : I also confirm that when I define a new model (here a .iges type) on the database for a missing part, the "update model" goes wrong (I think it tries to import in 'color' the .iges and then it goes to the same error. I reload all board without color to work.

     
    • Mariusz

      Mariusz - 2017-04-30

      Hi,
      I added option 'Colorize elements' in update model window.

       
  • Mariusz

    Mariusz - 2017-04-12

    Hi,
    so it means that this is error coming from FreeCAD - sometimes there are problems with boolean union function. I have some ide how to skip this bug.

     
  • Anonymous

    Anonymous - 2018-12-01
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.