Macro FCInfo/ko

FCInfo 매크로

Description
선택한 형상에 대한 정보를 제공하고 길이, 기울기(도, 라디안, 경사도, 백분율), 면적, 부피 및 무게를 다양한 단위(미터법 및 영국식 단위)로 변환하여 표시할 수 있습니다. 이제 이 매크로는 편집 상태에서 스케치의 요소에도 적용됩니다.


프랑스 판Version française

Macro version: 1.29b
Last modified: 2023/05/10
FreeCAD version: 모든 버전
Download: ToolBar Icon
Author: Mario52

Author
Mario52
Download
ToolBar Icon
Links
Macro Version
1.29b
Date last modified
2023/05/10
FreeCAD Version(s)
모든 버전
Default shortcut
None
See also
Arch Survey, Macro SimpleProperties, Macro FCInfoGlass

설명

선택한 형상에 대한 정보를 제공하고 길이, 기울기(도, 라디안, 경사도, 백분율), 면적, 부피 및 무게를 다양한 단위(미터법 및 영국식 단위)로 변환하여 표시할 수 있습니다. 이제 이 매크로는 편집 상태에서 스케치의 요소에도 적용됩니다.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro")
<class="rawcodeurl"><a href="https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro">raw code</a>


FCInfo

용법

객체를 선택하고 애플리케이션을 시작하거나, 애플리케이션을 먼저 시작한 다음 객체를 선택합니다. 객체가 분석되고 수집된 정보를 보여주는 대화 상자가 열립니다. 새로운 선택이 있을 때마다 길이 단위는 mm로 재설정되고 각도 단위는 십진수로 재설정됩니다.

window
window


영역 1: 문서

FCInfo Document

(상자를 숨기려면 변수 switch_setVisible_GBox_001_Documentfalse로 체크할 수 있습니다)

영역 2: 마우스 클릭 좌표

FCInfo Coordinate

(상자를 숨기려면 변수 switch_setVisible_GBox_002_Coordinate_Mousefalse로 체크할 수 있습니다)

영역 3: 포인트에 색상 넣기

FCInfo Color_on_point

  • Color on point clicked.
    • value 0.0 to 1.0
  • Line Edit display the color value in different formats: "3435973887" , "#cccccc" , "0xcccccc" , "204,204,204" , "(0.8,0.8,0.8)"
    • 3435973887 : Mode RVBA Int unsigned (format in FreeCAD preferences) Alpha = 255
    • #cccccc : Mode RVB Hexadecimal (Qt: setStyleSheet("color : #cccccc"))
    • 0xcccccc : Mode RVB Hexadecimal (Python: hex(0xcccccc)
    • "204,204,204 " : RVB decim: Mode RVB (Qt: setStyleSheet(u"QLineEdit {"background-color: rgb(204, 204, 204)};"))
    • (0.8,0.8,0.8) : RVB float: Mode RVB format float de 0.0 à 1.0
    • (The number of decimals depend of the option "x (Decimals)")
  • Sub.Objet : Change the color of the selected object or subobject. If this box is activated Sub.Objet the face or sub Object selected is modified or duplicated. If it is not activated (default) the object is modified (color) or duplicated
  • Coul. Obj : Change the color of the shape or the face depend of the choice. In case object Mesh or Points the complete object is colored.
  • Dupl. Obj : Duplicates the face or the object depend to the chosen option. In the case of a Mesh object or Points the complete object is colored. Duplicate a Mesh object keeps the original and creates a solid shape. Duplicate a Points object keeps the original and creates a copy.
  • 0  : Degree of transparency of the selected face or object depend on the option chosen 0 = opaque , 100 = transparent

(you can checked to false the variable switch_setVisible_GBox_003_Color for hidden the Box)

영역 4: 메시 구성 요소

FCInfo Component Mesh

선택 항목이 메시 객체인 경우에만 "구성 요소(Componants)"'영역이 표시되고 다음을 보여줍니다.

(상자를 숨기려면 변수 switch_setVisible_GBox_004_Object_Meshfalse로 체크할 수 있습니다)

영역 5: 단위

FCInfo Units

(상자를 숨기려면 변수 switch_setVisible_GBox_005_Value_Unitfalse로 체크할 수 있습니다)

영역 6: 기울기

FCInfo Inclination

영역 7: 표면과 부피

FCInfo Surface and Volume

(상자를 숨기려면 변수 switch_setVisible_GBox_007_Surface_and_Volumefalse로 선택할 수 있습니다)

영역 8: 가격

FCInfo Cost

'(상자를 숨기려면 변수 switch_setVisible_GBox_008_Cost_And_Pricefalse로 선택할 수 있습니다)

영역 9: 경계상자

FCInfo BoundBox

(you can checked to false the variable switch_setVisible_GBox_009_BoundBox for hidden the Box)

영역 10: 중심

FCInfo Center of...

(상자를 숨기려면 변수 switch_setVisible_GBox_010_Center_Massfalse로 체크할 수 있습니다)

영역 11: 관성

FCInfo Inertia

same for length and weigth

(you can checked to false the variable switch_setVisible_GBox_011_Inertia for hidden the Box)

영역 12: 스프레드시트

FCInfo Disabled

  • Disabled module CheckBox for search or not all details of the object. If it is not checked, only the principal value is displayed.
  • Vertexes and details of the shape (compt_Edge), (compt_Faces), (compt_Vector of the Face)
  • Max 200 lines in the table, if there are more than 200 lines it appears (!+ 200) and the number of lines
  • If the object is complicated with many objects, the time is long and the search is repeated with every mouse click. The write function in the spreadSheet included, decreases the display time for this it is disabled by default
  • Full details can save be the Save button in a file in CSV format and can be viewed the file in spreadsheet with the Read or by an external spreadsheet as LibreOffice OpenOffice or other

(you can checked to false the variable switch_setVisible_GBox_012_SpreadSheet for hidden the Box)

영역 13: 스프레드시트 생성

FCInfo SpreedSheet

  • SpreadSheet : create a new spreadsheet in a document
  • SpreadSheet : the current spreadsheet. if the spreadsheet does not exist one spreadsheet is created
  • Refresh : refresh the list of spreadsheet in document
  • -  : the spreadsheet(s) present in document
  • Read : read the data in a spreadsheet saved .FCInfo or txt, asc, csv
  • Save : save the data in disk in the form selected below .FCInfo or txt, asc, csv
  • Tabulation : the separator is Tabulation (by default)
  • Comma : the separator is Comma
  • Semicolon : the separator is Semicolon
  • Space : the separator is Space

Option for save or read the spreadsheet with different separator, Tabulation, Comma, Semicolon, Space
The Tabulation are the separator for the FreeCAD [Spreadsheet_Workbench|Spreadsheet workbench]
The number of this four separator are calculate for help if unknown
The COMMA are the old (01.16 and before) separator of the FCInfo macro
Now for compatibility with the FreeCAD spreadsheet and since 01.17 version the TABULATION is the separator by default
If you want to convert your old FCInfo spreadsheet : Open it in FCInfo and save it with the Tabulation option checked
(you can checked to false the variable switch_setVisible_GBox_013_SpreadSheet_Creation for hidden the Box)

영역 14: 주요 도구

FCInfo Main

  • Info : if this CheckBox is checked, the informations are displayed in the report view window
  • Point : if checked, one point is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Axis : if checked, one axis is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Plane : if checked, one axis plane is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Clip-B0 : None clipBoard
  • Clip-B1 : If checked the coordinate are copy in the clipBoard Form : FreeCAD.Vector(X.0, Y.0, Z.0) FreeCAD model
  • Clip-B2 : If checked the coordinate are copy in the clipBoard Form : X, Y, Z with Comma separator
  • Clip-B3 : If checked the coordinate are copy in the clipBoard Form : X Y Z as is with Space separator
  • Left/Right : if this CheckBox is not checked, the window macro are displayed to right (default). If it is checked the window macro are displayed to left.
    If the option is 1 mode fly (User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/seTPositionFlyRightLeft) this button is not visible .
  • 4 (Decimales)  : give the number of decimal displayed
  • 12 (Dim. texte)  : give the dimensionof text in the macro
  • Forum  : direction FCInfo forum tread (you must to be connected to internet)
  • Wiki : direction Wiki FCInfo (you must to be connected to internet)
  • Ref  : refresh the display of data in report view
  • Exit : exit properly the macro (not use the red cross of the window)

(you can checked to false the variable switch_setVisible_GBox_014_Main_Tools for hidden the Box)

매크로를 실행하면 매크로가 활성 상태를 유지하고 창은 계속 표시됩니다. Exit를 눌러 매크로를 종료합니다. x로 종료하면 매크로는 메모리에 남아 있으며, 데이터는 FreeCAD의 "보고서 보기"에 나타납니다. 이를 종료하려면 FreeCAD를 다시 시작해야 합니다.

선택 사항

사용된 단위

길이 단위:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

각도 :

  1. decimal degree, ex: 174.831872611°
  2. degree minute seconde, ex: 174° 49' 54.741401''
  3. radian, ex: 3.05139181449 rad
  4. grade, ex: 194.257636235 gon
  5. percent ex: 30° = 57.74%

FCInfo 표시에서 각도에 대한 이해.

무게 단위 :

ton, quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct

FCInfo 구성

  • Location : Tools > Edit parameter > *User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/
  • switchNotInfoOnBeginning # SetBool true or [false]
    • Display or not this text information on run macro
      • [false] = display this information
      • true = this Information is Not displayed On Beginning
  • switchVersionSearch # SetBool true or [false]
    • Search if one new version exist on run macro
  • switchWarning # SetBool true or [false]
    • Display or not display the window warning in case not good selection
  • switchCreatePoint # SetBool true or [false]
    • Check the Create point checkBox
  • switchCreateAxis # SetBool true or [false]
    • Check the Create axis checkBox
  • switchCreatePlane # SetBool true or [false]
    • Check the Create plane checkBox
  • switchDisplayInfoObject # SetBool true or [false]
    • Check the info checkBox
  • switchClearDisplayReportView # SetBool true or [false]
    • if switchClearDisplayReportView is true the ReportView is cleared
  • seTWidgetPosition # SetBool true or [false]
    • Check the Widget Position Left/Right checkBox
    • if seTWidgetPosition [false] : if seTPositionFlyRightLeft = 2 = docked to Right
    • if seTWidgetPosition true  : if seTPositionFlyRightLeft = 3 = docked to Left
    • if it is 1 the window macro is not docked
  • switchBoundBoxCreateText # SetBool true or [false]
    • Create the text dimension of the BoundBox
  • seTBoundBoxTextHeigth # seTBoundBoxTextHeigth = 3.0
    • Give the Heigth of the text dimension (independent of the seTTextHeigthValue)
  • seTBoundBoxTextArround # seTBoundBoxTextArround = 3
    • Give the arround of the text dimensions (independent of the seTDecimalValue)
  • seTMemoClipBoard # SetInt [0], 1, 2, 3
    • Give one value [0], 1, 2, 3 clipBoard
      • [0] = desactivate the clipBoard
      • 1 = the data string is memorised to : FreeCAD.Vector( X, Y, Z )
      • 2 = the data string is memorised to : X, Y, Z
      • 3 = the data string is memorised to : X Y Z
  • seTTextHeigthValue # SetInt 11
    • Give one text heigth value of the macro
  • seTDecimalValue # SetInt 4
    • Give the number of decimal displayed
    • If the number is -1 the total decimal value is displayed)
  • seTMaterialCurrentIndex # SetInt 0
    • Set the index of the ComboBox
  • seTMaterialFileName # SetString FCInfo_material.txt
    • Name of the material file
  • seTMaterialSavePathName # SetString C:\...\Macro\FCInfo_material.txt
    • Path name of the material file
  • seTMaterialPrice # SetFloat
    • Material price by Kg
  • seTMaterialSuffixDevise # SetString
    • Devise money
  • seTMaterialSuffixCost # seTMaterialSuffixCost
    • Suffix Devise cost
  • seTMaterialCost # SetFloat
    • Material cost
  • seTDensiteValue # SetFloat 1.0
    • Give the densite value
  • seTDensiteDecimalNumber # SetInt 4
    • Give the number of decimal for the densite value
  • seTDensiteSingleStep # SetFloat 1.0
    • Give the step for one click, by default 1.0 (possible 0.01 or ...)
  • seTDensiteSuffixChain # SetString kg (by dm3)
    • Choice your suffix string
  • seTPositionFlyRightLeft # SetInt 2
    • Choice your position, Fly, [Right], Left
      • 1 = the macro window is fly (not docked)
      • [2] = the macro window is positioned to Right
      • 3 or other = the macro window is positioned to Left
  • seTIndexUnitWeight # SetInt
    • Set unit Weight index
  • seTUnitSymbolMicro # U
    • Set Symbol Micro
  • seTUnitSymbolCube # 3
    • Set Symbol Cube
  • seTUnitSymbolCarre # 2
    • Set Symbol Square
  • seTIndexUnitLength # SetInt
    • Set unit Length index
  • setBSplineToByArcValue # SetFloat 0.00001
    • Set unit for cut the BSpline for seack the radius on point given
  • setMeshTopologyValue # SetFloat 0.1
    • Set unit for create the Mesh to Shape
  • switchBSplineCreateCircleConstructorAxis #SetBool true or [false]
    • Display the axis of the circles (arcs) for create the BSpline
  • switchBSplineCreateCircleConstructor #SetBool true or [false]
    • Display the circles cretors for create the BSpline
  • switchCreateLineDiVatNatOnClick #SetBool true or [false]
    • Create the Line info on point (0,0,0) or on point mouse clicked (x,y,z) if it is true
    • If it is true one '*' is displayed in front of text. EX: '*Direction'


This switch (section GroupBox) allows you to view only the desired section(s) (just visual) false or true.

All calculations are done without taking account of this option

  • section GroupBox begin
    • switch_setVisible_GBox_001_Document = True (1)
    • switch_setVisible_GBox_002_Coordinate_Mouse = True (1)
    • switch_setVisible_GBox_003_Color = True (1)
    • switch_setVisible_GBox_004_Object_Mesh = True (1)
    • switch_setVisible_GBox_005_Value_Unit = True (1)
    • switch_setVisible_GBox_006_Inclination = True (1)
    • switch_setVisible_GBox_007_Surface_and_Volume = True (1)
    • switch_setVisible_GBox_008_Cost_And_Price = True (1)
    • switch_setVisible_GBox_009_BoundBox = True (1)
    • switch_setVisible_GBox_010_Center_Mass = True (1)
    • switch_setVisible_GBox_011_Inertia = True (1)
    • switch_setVisible_GBox_012_SpreadSheet = True (1)
    • switch_setVisible_GBox_013_SpreadSheet_Creation = True (1)
    • switch_setVisible_GBox_014_Main_Tools = True (1)
  • section GroupBox end

스크립트

"FCInfo.FCMacro"라는 파일에 매크로 내용을 복사합니다.

아이콘에 이미지 위치를 다운로드한 다음 마우스 오른쪽 버튼을 클릭하여 "다른 이름으로 저장"을 클릭합니다(이름을 변경하지 마세요)

추신: 코드가 너무 길어서 위키 페이지에 담을 수 없습니다(현재 위키 페이지는 64KB만 허용합니다). 매크로 코드는 포럼에 게시했습니다

gist에 있는 매크로 파일을 다운로드하세요 오른쪽에 고정됨


(또는 포럼에서. )

추신: 이 매크로는 getSelection()을 사용하고 객체 목록은 1부터 시작합니다. 예: 상자의 경우 Edge1~Edge12이고 콘솔의 코드는 0부터 시작합니다. 예: 상자의 경우 Edge[0]~Edge[11]
이는 정상입니다. OpenCascade 내부에서 배열/목록의 계산은 항상 1'에서 시작하고 0에서 시작하지 않습니다.

제한사항

항상 Exit 버튼을 눌러종료 하세요. Exit 버튼을 누르지 않고 프로그램을 종료하면, 프로그램은 메모리에 남아 계속 실행되고, 디스플레이는 "보고서 보기"에 머물러 있습니다.
표에는 객체의 처음 200개 요소만 표시됩니다. 객체에 200개가 넘는 항목이 있는 경우 (! +200) 신호가 표시됩니다. 전체 데이터 목록은 Save 버튼을 눌러 저장된 파일에서 볼 수 있습니다.

실행 후 창 매크로가 보이지 않으면 아래 창을 확인하세요.


프로젝트:
테이블에서 파일을 직접 읽기. 완료
"모서리"와 해당 좌표를 일치시키기. 완료
물질과 밀도의 연관성
전역 객체보다는 요소에 대한 기울기 완료
FreeCAD 인터페이스에 바로 박어 넣기 완료

버전

ver "1.30c" 2025/01/28 : replace connect comboBox for Arch Linux

replace:

QtCore.QObject.connect(self.comboBox_Unit, QtCore.SIGNAL(u"currentIndexChanged(QString)"), self.SIGNAL_comboPoids_Changed)

by:

self.comboBox_Unit.currentTextChanged.connect(self.SIGNAL_comboPoids_Changed)

ver "1.30b" 2025/01/20 : replace the slash Windows "\" by the slash Python "/"

ver "1.30" 2025/01/02 : delete all reference to PySide PySide2 and QtWidgets modify the (Qt) Save file

#
import PySide2
from PySide2 import QtGui , QtCore, QtWidgets
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QMessageBox
from PySide2.QtWidgets import QTableWidget, QApplication
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *

            OpenName, Filter = PySide2.QtWidgets.QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide2

replaced and change command by

#
import PySide
try:
    from PySide import QtWidgets
    from PySide.QtWidgets import *
except Exception:
    None
from PySide import QtGui , QtCore
from PySide.QtGui import *
from PySide.QtCore import *

            OpenName, Filter = QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide

ver "1.29b" 2024/05/10 PySide2 관성 "MatrixX1*uniteM을 (MatrixX1*uniteM)"으로 수정하고 spinBox 관성을 추가했습니다.

ver 1.29 2024/05/06 프랑스어 버전 fr PySide6 sylvainbx 작성 https://gist.github.com/sylvainbx/af09a30be3e1427de56305825331fb29 sylvainbx님께 감사

ver 1.28b 1.28c 2023/10/30 철자

ver 1.28 01/09/2023 변수 이름 수정, 각 영역 숨김 가능, 문서에 데이터 스프레드시트 저장, 표면 반경, webWiki 및 webForum 버튼 추가

ver 1.27 2023/06/30 스타일시트 최적화, 좌우 위치 수정, 스케쳐 편집 후 뷰 복원

self.PB_00_Decrement.setStyleSheet("background-color: white; border:2px solid rgb(215, 10, 22);")      # bord white and red

로 대체됨

self.PB_00_Decrement.setStyleSheet("QPushButton {background-color: white; border:2px solid rgb(215, 10, 22)};")      # bord white and red
FreeCAD.ActiveDocument.openTransaction(u"FCInfo")    # memorise les actions (avec annuler restore)
FreeCAD.ActiveDocument.commitTransaction()           # restore les actions  (avec annuler restore)
#FreeCAD.ActiveDocument.abortTransaction()            # abandonne les actions(avec annuler restore)
try:
        self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)    # destroy
        self.window.deleteLater()                                     # destroy
        self.window.destroy()                                         # destroy
except Exception:
        None

How do i exit from FreeCAD instead of Python?

instead:

self.window.hide()

그리고 "오류 메시지" 창을 기본적으로 "거짓"으로 표시할지 여부를 선택할 수 있는 가능성을 추가했습니다. 경고 창을 활성화하려면 다음으로 이동하세요.

FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo > switchWarning

ver 1.20, 2018년 1월 29일 최적화 ver 1.19, 2018년 1월 20일 원하는 경우 객체의 모든 요소를 ​​감지하는 데 사용할 체크박스를 만듭니다. 매크로가 더 빠릅니다. 최적화


참고 문서 연결

아치 조사 건축 작업대의 측량도 참고하세요.

포럼에서 Info Workbench - 아이콘에 대한 도움말을 부탁드립니다.주제로 의견을 나눌 수 있습니다
FCInfo Macro의 또 다른 게시물이 있습니다.