BOLTS Open Library of Technical Specifications

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by ulrich1a »

bernd wrote:Did I need to install ymal first and copy the files or do I just need to copy the yaml installation files in that folder.
I tried to run the yaml installer inside of the FreeCAD-python-environment. But the installer then closed only FreeCAD and could not do any installing.
So I had to install the yaml for Python 2.7 for Windows. It installed a directory and some files in the Python-Sidepackages. I copied these at the corresponding site in the FreeCAD-folder.

Ulrich
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by jreinhardt »

Thanks for figuring this out. I don't have a windows machine, so I cannot test this.

I will update the documentation on the BOLTS site with this information.
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
User avatar
s-light
Posts: 119
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: BOLTS Open Library of Technical Specifications

Post by s-light »

I tried to install Bolts
('BOLTS_FreeCAD_0.3_lgpl2.1+.zip' 0.3 2014-4-24)
on a Windows 7 FreeCAD 0.15
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4572 (Git)
Branch: master
Hash: be2bb52796ae1be001882da114e8272c4c746af0
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1


the coping from the yaml files just wokred. but i don't know how to get the 'pysideuic' modul.
if it is contained in the pySide package
can someone help how to install it for a python2.7 on windows -
if the pip defaults to my later added python3 installation?
(so is there a way to tell pip to install a package for a specific python version?? )

i would like to try bolts :-)

thanks for your help!
sunny greetings
stefan
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: BOLTS Open Library of Technical Specifications

Post by sgrogan »

@s-light

did you try bolts and get an error?

I have the same OS version as you and I didn't have the pysideuic problem that ulrich1a had.
Maybe you guys have Python in your system path and FreeCAD is finding this first before the built in python?
Pyside tools should be there in the DevSnaphots because its in the Libpack they are build against.
"fight the good fight"
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by ulrich1a »

sgrogan wrote:Maybe you guys have Python in your system path and FreeCAD is finding this first before the built in python?
I have Python 2.7 installed at the windows-system at work. It had pyside-tools installed before I tried Bolts but it did not help. So I copied it from my installation also to the FreeCAD-folder.
I do not have Python 3 installed at the windows-system.

As sgrogan is using the latest dev-snapshot, this may be the key to get it to work without pysideuic. Someone has to try.

Ulrich
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: BOLTS Open Library of Technical Specifications

Post by sgrogan »

Thanks Ulrich

Thanks for keeping this alive.

The Libpack that all of the windows dev snapshots are based upon is the same.

Soomething like this: C:\UsersUSERNAME\Desktop\FClibs_vc12_x64\FreeCADLibs_11.0_x64_VC12\bin

It should be here: C:\Users\UserName\Desktop\FClibs_vc12_x64\FreeCADLibs_11.0_x64_VC12\bin
"fight the good fight"
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: BOLTS Open Library of Technical Specifications

Post by ulrich1a »

s-light wrote:i would like to try bolts :-)
Please can you test the following changes to a BOLTS-file, in order to get rid of the PYSide-tools-depencency.

Edit the following file /BOLTS/gui/freecad_bolts.py from line 22 to line 33 as you see below:

Code: Select all

#You should have received a copy of the GNU Lesser General Public
#License along with this library; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

from os.path import dirname, join
bolts_path = dirname(__file__)
from BOLTS import USE_PYSIDE

import FreeCAD, FreeCADGui

if USE_PYSIDE:
	from PySide import QtCore, QtGui
	#from FreeCADGui import PySideUic as uic

	try:
		Ui_BoltsWidget,QBoltsWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'bolts_widget.ui'))
		Ui_ValueWidget,QValueWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'value_widget.ui'))
		Ui_BoolWidget,QBoolWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'bool_widget.ui'))
		Ui_TableIndexWidget,QTableIndexWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'tableindex_widget.ui'))
		Ui_PropertyWidget,QPropertyWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'property_widget.ui'))
	except ImportError:
Please be careful. The forum-software introduced line-breaks, where should be no ones.

I can not test on a Windows-sytem now, as I here are on a Linux-System.

Ulrich
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: BOLTS Open Library of Technical Specifications

Post by NormandC »

ulrich1a wrote:Please be careful. The forum-software introduced line-breaks, where should be no ones.
Only if you click on "SELECT ALL". If you select the code manually you should not have problems.
User avatar
s-light
Posts: 119
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: BOLTS Open Library of Technical Specifications

Post by s-light »

Hi Ulrich,

i am willing to try on windows :-)
(as long as i use it ;-) )

i have made the changes - just to verify here my changed file:
(c:\Users\Stefan\AppData\Roaming\FreeCAD\BOLTS\gui\freecad_bolts.py)

Code: Select all

from os.path import dirname, join
bolts_path = dirname(__file__)
from BOLTS import USE_PYSIDE

import FreeCAD, FreeCADGui

FreeCAD.Console.PrintMessage(FreeCADGui.PySideUic.__doc__)

if USE_PYSIDE:
    from PySide import QtCore, QtGui
    # from FreeCADGui import PySideUic as uic
    
    try:
        # Ui_BoltsWidget,QBoltsWidget = uic.loadUiType(join(bolts_path,'bolts_widget.ui'))
        # Ui_ValueWidget,QValueWidget = uic.loadUiType(join(bolts_path,'value_widget.ui'))
        # Ui_BoolWidget,QBoolWidget = uic.loadUiType(join(bolts_path,'bool_widget.ui'))
        # Ui_TableIndexWidget,QTableIndexWidget = uic.loadUiType(join(bolts_path,'tableindex_widget.ui'))
        # Ui_PropertyWidget,QPropertyWidget = uic.loadUiType(join(bolts_path,'property_widget.ui'))
        Ui_BoltsWidget,QBoltsWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'bolts_widget.ui'))
        Ui_ValueWidget,QValueWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'value_widget.ui'))
        Ui_BoolWidget,QBoolWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'bool_widget.ui'))
        Ui_TableIndexWidget,QTableIndexWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'tableindex_widget.ui'))
        Ui_PropertyWidget,QPropertyWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'property_widget.ui'))
    except ImportError:
        FreeCAD.Console.PrintError("\n\nuic import failed. Make sure that the pyside tools are installed\n")
        raise
    from PySide.QtCore import Slot
    def unpack(x):
        return x
else:
i have added some line breaks to your Console.PrintError so it is a clearer line ;-)
and have added the 'FreeCAD.Console.PrintMessage(FreeCADGui.PySideUic.__doc__)'
the output in the Report view if i execute the scirpt is following:

Code: Select all

PySideUic helper module

uic import failed. Make sure that the pyside tools are installed
Traceback (most recent call last):
  File "C:/Users/Stefan/AppData/Roaming/FreeCAD/start_bolts.FCMacro", line 1, in <module>
    import BOLTS
  File "C:\Users\Stefan\AppData\Roaming\FreeCAD\BOLTS\__init__.py", line 40, in <module>
    from gui.freecad_bolts import BoltsWidget
  File "C:\Users\Stefan\AppData\Roaming\FreeCAD\BOLTS\gui\freecad_bolts.py", line 36, in <module>
    Ui_BoltsWidget,QBoltsWidget = FreeCADGui.PySideUic.loadUiType(join(bolts_path,'bolts_widget.ui'))
  File "<string>", line 1, in <module>
<type 'exceptions.ImportError'>: No module named pysideuic
after some try and error i have found a way to install PySide for my system python2.7:

Code: Select all

C:\Python27\Scripts> .\pip2.exe install PySide
after this i just could copy the directory
'c:\Python27\Lib\site-packages\pysideuic'
to 'FreeCAD_0.15.4572_x64_dev_bin\bin\Lib\site-packages\'

and now it works with the original (unmodified) BOLTS :-)

thanks for your time!
sunny greetings
stefan
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: BOLTS Open Library of Technical Specifications

Post by sgrogan »

On windows BOLTS installation should now work out of the box (In both the 0.15.xxxx_RC2 and 0.16.xxxx dev versions beginning with 0.16.4748)
"fight the good fight"
Post Reply