Power users hub/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
Line 46: Line 46:
* [[Pivy/sv|Pivy]]: Hur man kommer åt och ändrar scengrafen
* [[Pivy/sv|Pivy]]: Hur man kommer åt och ändrar scengrafen


'''Kontrollera Qt gränssnittet'''
===Controlling the Qt interface===
* [[PySide]]: How to access the interface, and modify its contents
* [[PySide/sv|PySide]]: Hur man kommer åt gränssnittet, och förändrar dess innehåll
* [[Embedding FreeCADGui|Using the FreeCAD GUI]] in another Qt application with PyQt
* [[Embedding FreeCADGui/sv|Använda FreeCADs gränssnitt]] i en annan Qt applikation med PyQt


'''Arbeta med parametriska objekt'''
'''Arbeta med parametriska objekt'''
Line 83: Line 83:
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python för nybörjare] - en stor övning som täcker allt det grundläggande
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python för nybörjare] - en stor övning som täcker allt det grundläggande


'''PyQt''' - Hur man skapar och hanterar FreeCAD's Qt användargränssnitt från python
'''PySide''' - How to create and manage FreeCAD's Qt UI interface from python
* [http://zetcode.com/gui/pysidetutorial/ PySide tutorial] : A platform-agnostic tutorial showing the usage of PySide with examples
* [http://www.cs.usfca.edu/~afedosov/qttut/ Grundläggande PyQt övning] : en enkel och kort linux-baserad övning som kommer att förklara hur man arbetar med PyQt och Qt Designer
* [http://www.pythoncentral.io/series/python-pyside-pyqt-tutorial/ PySide/PyQt tutorial] : A easy to read tutorial that covers PySide and PyQt with examples
* [http://zetcode.com/tutorials/pyqt4/firstprograms/ Första programmen i PyQt4] : En plattform-agnostisk övning som visar innanmätet i python + qt
* [http://qt-project.org/wiki/PySideDocumentation PySide documentation] : from the Qt Project (the people who wrote it all)
* [http://vizzzion.org/?id=pyqt programmera Qt applikationer i python] : En djupare övning som täcker hela processen i arbetet med qt och python.
* [http://qt-project.org/wiki/QtCreator_and_PySide Using QtCreator in PySide] : also from the Qt Project
* [http://srinikom.github.io/pyside-docs/index.html PySide reference] : endless detail on the minutiae of PySide and Qt, a reliable reference source
* [http://nullege.com/codes/search?cq=PySide PySide code snippets] : a searchable database of PySide code snippets


The following two references are PyQt specific (not PySide) but may offer some information of use:
The following two references are PyQt specific (not PySide) but may offer some information of use:

Revision as of 21:48, 20 February 2015

150
150

Detta är platsen att komma till om du vill ha en djupare insikt i FreeCAD. Här kan du lära dig om hur du anpassar FreeCAD för dina behov.

Dessa sidor är i ett tidigt utvecklingsstadie. Om du inte kan hitta den information du letar efter, eller har hittat användbar information på något ställe sim vi inte har länkat till, var då snäll och lämna en kommentar på pratsidan, eller varför inte att du själv lägger till innehåll här!

One of the nicest features of FreeCAD is that you can script and extend it extremely far without the need to compile anything or touch the source code. All the scripting part is done in Python, a very powerful but simple programming language. With simple Python scripts, you have total access to about any part of FreeCAD. For example, you can:

  • Create and modify geometry: Is there a special object you need that's not present in the default FreeCAD installation? You can easily create a new object type, either from scratch or by adapting an existing type.
  • Create custom tools and commands: At the moment, FreeCAD already has extensive functionality, but there aren't many convenient tools and commands for the final user yet. But it is already easy to create your own sets of tools.
  • Modify the interface: The FreeCAD user interface is still very basic at this stage. But everything is there for you to extend it to your needs. You can, for example, create toolbars to put your own tools, create special panels for interacting with your tools, etc.
  • Modify the scene representation: FreeCAD has separate processes for building up and computing the geometry and displaying that geometry on your screen. You have full access to the way the scene contents are displayed on screen, therefore you can modify that representation, interact with it, or add all kinds of custom behaviours and screen widgets, like information, draggers, anchors or temporary entities.

Anpassa FreeCAD

Skriptning i FreeCAD

Allmänt

Modules

As the functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.

  • The Builtin modules are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.

""Arbeta med nät""

Använda OpenCasCade

Komma åt Coin scengrafen

Kontrollera Qt gränssnittet

Arbeta med parametriska objekt

Exempel

  • Kodbitar en samling med FreeCAD python kod som du kan använda som ingredienser i dina skript...
  • Linjeritningsfunktionen: Hur man bygger ett enkelt verktyg att rita linjer med
  • Skapa dialoger: Hur man konstruerar dialoger med Qt designer, och använder dem i FreeCAD
  • Bädda in FreeCAD: Hur man importerar FreeCAD som en pythonmodul i andra applikationer
  • Skissmodulen adderar grundläggande 2D rintningsfunktioner till FreeCAD. Den är helt och hållet skriven i python, så den kan vara ett bra exempel om du vill skriva dina egna moduler.
  • FreeCAD's vektorbibliotek : Några praktiska funktioner för att manipulera FreeCAD vektorer. Detta bibliotek är även inkluderat i Skissmodulen.

API funktioner

Den kompletta API beskrivningen hittas här. Notera att den kan vara ofullständig, eftersom vi fortfarande inte har hittat ett sätt att automatiskt inkludera den på denna wiki. För mer rättvisande information, titta i modulerna direkt från FreeCAD.

Avancerade ändringar

Python övningar

Dessa är bra allmänna övningar, inte specifika för FreeCAD, som kan vara intressanta för dig om du är helt ny på python.

Python

PySide - How to create and manage FreeCAD's Qt UI interface from python

The following two references are PyQt specific (not PySide) but may offer some information of use:

Pivy' - Hur man interagerar med FreeCAD's 3D scener

Grupprojekt

On the Community portal, you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to Help FreeCAD.