Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pigreco
Last active April 12, 2016 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pigreco/b54bae7dc31bf7cf61efa40891f16adc to your computer and use it in GitHub Desktop.
Save pigreco/b54bae7dc31bf7cf61efa40891f16adc to your computer and use it in GitHub Desktop.
"""
/***************************************************************************
Name : Label DXF 3D
Description : popola il campo OGR_STYLE per label DXF 3D
Date : 11 - aprile - 2016
copyright : (C) 2016 by Salvatore Fiandaca
email : pigrecoinfinito@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from qgis.core import *
from qgis.gui import *
@qgsfunction(args='auto', group='Custom')
def label_dxf_3d(campo, feature, parent):
a = 'LABEL(f:,s:3000pt ,t:'
b = str(campo)
c = ')'
return a + b + c
@pigreco
Copy link
Author

pigreco commented Apr 11, 2016

il file 'etichette_3D_dxf.py' è una semplice funzione (label_3d_dxf) scritta in python da poter utilizzare nel calcolatore di campi di QGIS, basti mettere il file in C:\Users\nome_utente.qgis2\python\expressions
al riavvio di QGIS troverete la nuova funzione sotto 'custom' (vedi immagini).

immagine 9
immagine 7
immagine 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment