Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- babaroga
- Posts: 180
- Joined: Sun Aug 14, 2016 6:52 pm
- Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
It will mean a lot, if there is something like isChildOf() property in pattern or mirror so you can trace back to original.
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
First of all: Thank you very much for this great tool! I'm trying it out right now and I really appreciate it. I've found two things which didn't work as expected. In addition, I've some more questions and wishes
chamfers
This one was already reported by Shalmeneser and apparently you've already worked on it. Nevertheless, I think it's not yet perfect.
changing line attributes
I assumed it would be enough to select any line and select one of the colors to change the color of the selected line. But nothing is happening here. What am I doing wrong?
edit: Clicking on "change the line attributes" doesn't work and gives me something like this:
dimension symbol
Great that I'm now able to add the dimension symbol without copying it from the internet / looking up the UTF8-code But I've discovered that I'm not able to apply it to all kind of dimensions. It's not working with TechDraw_HorizontalExtentDimension and https://wiki.freecadweb.org/TechDraw_Ve ... tDimension.
example file for both cases:
feature request
I'd like to be able to center the "number" showing the value of a dimension at a (for example) horizontal dimension. I think that's the initial state after adding a dimension.
Wiki entry
I think this macro is missing here: Macros_recipes
chamfers
This one was already reported by Shalmeneser and apparently you've already worked on it. Nevertheless, I think it's not yet perfect.
Shalmeneser wrote: ↑Sat Jul 10, 2021 8:29 pm Why the vertical and horizontal bevel dimensions are not the same for the angle ? (done with PartDesign_Chamfer : one dimension 1 mm)
The attached example shows this behavior:
changing line attributes
I assumed it would be enough to select any line and select one of the colors to change the color of the selected line. But nothing is happening here. What am I doing wrong?
edit: Clicking on "change the line attributes" doesn't work and gives me something like this:
Code: Select all
22:01:57 DVPPI::getCenterLinebySelection - centerLine for tag Edge8 not found
22:01:57 DVPPI::getCosmeticEdgebySelection - edge for name Edge8 not found
dimension symbol
Great that I'm now able to add the dimension symbol without copying it from the internet / looking up the UTF8-code But I've discovered that I'm not able to apply it to all kind of dimensions. It's not working with TechDraw_HorizontalExtentDimension and https://wiki.freecadweb.org/TechDraw_Ve ... tDimension.
example file for both cases:
feature request
I'd like to be able to center the "number" showing the value of a dimension at a (for example) horizontal dimension. I think that's the initial state after adding a dimension.
Wiki entry
I think this macro is missing here: Macros_recipes
Regards / Viele Grüße
Max
Max
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Replace in line 4387 "int" by "round"
Code: Select all
Alpha = str(round(math.degrees(abs(math.atan(Dx/Dy)))))
Code: Select all
Alpha = str(round(math.degrees(abs(math.atan(Dy/Dx)))))
Extend line 2646 to
Code: Select all
if Elem.Object.TypeId == 'TechDraw::DrawViewDimension' or Elem.Object.TypeId == 'TechDraw::DrawViewDimExtent':
First select the attributes (type, line thickness, color).
If you create a new line using the macro (circle centerline, cosmetic thread etc.) it receives the selected attributes.
If you select existing cosmetic lines and press the "Change the line attributes" button, the lines change to the selected attributes.
It is easy to realize this in python, but it will be difficult to handle it. Before manipulating any measure you have to select it. Only the measure value (number) can be selected. If you select it using the curser you usually move it a little bit (without aim). Therefore the positioning and cascading tools keep the position of the number. A solution could be to have an optional choice keep/center when using the position and cascade tools.
OK, good idea I will try to do this.
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Greetings to the Community!
.... two examples of how the corrections made to the code work
.... two examples of how the corrections made to the code work
- Attachments
-
- Example_1_corrections_made.gif (400.48 KiB) Viewed 6854 times
-
- Example_2_corrections_made.gif (320.5 KiB) Viewed 6854 times
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Doneedi wrote: ↑Sun Sep 19, 2021 12:20 pm Please have a look at https://forum.freecadweb.org/viewtopic.php?f=35&t=59334.
Would be fine if somebody could translate into russian language.
Sorry for not writing росси́йский.
Code: Select all
def russianDict(self,textEnglish):
dict_ = {"Attributes and Modifications":"Свойства и модификации",\
"Centerlines and Threading":"Осевые линии и резьбы",\
"Dimensions":"Размеры",\
"Line attributes:":"Свойства линий:",\
"Cascade spacing:":"Значение интервала:",\
"Quit":"Выход",\
"set lines to ":"установить тип линий ",\
"solid":"сплошная",\
"dashed":"пунктирная",\
"dotted":"точечная",\
"dashdot":"штрихпунктирная",\
"set lines width to ":"установить толщину линий ",\
"thick 0,70":"толстая 0,70",\
"middle 0,35":"средняя 0,35",\
"thin 0,18":"тонкая 0,18",\
"set lines color to ":"установить цвет линий ",\
"black":"черный",\
"grey":"серый",\
"red":"красный",\
"green":"зеленый",\
"blue":"синий",\
"magenta":"пурпурный",\
"cyan":"голубой",\
"yellow":"желтый"}
return dict_.get(textEnglish,textEnglish)
UPD 2. Fully Completed
Code: Select all
-------------174
def russianDict(self,textEnglish):
dict_ = {"Attributes and Modifications":"Свойства и модификации",\
"Centerlines and Threading":"Осевые линии и резьбы",\
"Dimensions":"Размеры",\
"Line attributes:":"Свойства линий:",\
"Cascade spacing:":"Значение интервала:",\
"Quit":"Выход",\
"set lines to ":"установить тип линий ",\
"solid":"сплошная",\
"dashed":"пунктирная",\
"dotted":"точечная",\
"dashdot":"осевая",\
"set lines width to ":"установить толщину линий ",\
"thick 0,70":"толстая 0,70",\
"middle 0,35":"средняя 0,35",\
"thin 0,18":"тонкая 0,18",\
"set lines color to ":"установить цвет линий ",\
"black":"черный",\
"grey":"серый",\
"red":"красный",\
"green":"зеленый",\
"blue":"синий",\
"magenta":"пурпурный",\
"cyan":"голубой",\
"yellow":"желтый"}
return dict_.get(textEnglish,textEnglish)
----------------797
def textEnglish(self):
buttonText = "Рисовать линии центра окружности"
helpText = "Рисовать линии центра окружности:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите несколько окружностей или дуг"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------1147
def textEnglish(self):
buttonText = "Рисовать окружность центров отверстий"
helpText = "Рисовать окружность центров отверстий:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите не менее 3-х отверстий, лежащих на одной окружности"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------1300
def textEnglish(self):
buttonText = "Рисовать осевую линию"
helpText = "Рисовать осевую линию по двум линиям:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите две линии"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------1566
def textEnglish(self):
buttonText = "Обозначение резьбы отверстия в плане"
helpText = "Обозначить резьбу отверстия в плане:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите несколько окружностей"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------1883
def textEnglish(self):
buttonText = "Обозначение резьбы вала в плане"
helpText = "Обозначить резьбу болта, штифта, вала в плане:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите окружности, обозначающие болт, штифт, вал"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2011
def textEnglish(self):
buttonText = "Обозначение резьбы на виде сбоку"
helpText = "Рисовать обозначение резьбы на виде сбоку:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите две параллельные линии"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2136
def textEnglish(self):
buttonText = "Обозначение резьбы вала на виде сбоку либо разрезе"
helpText = "Обозначить резьбу болта, штифта, вала на виде сбоку либо разрезе:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите две параллельные линии, обозначающие резьбовую часть болта, штифта, вала"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2290
def textEnglish(self):
buttonText = "Создать точки на пересечении"
helpText = "Создать точки на пересечении линий:"+ "\n"\
"- выберите две линии, окружности, дуги"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2449
def textEnglish(self):
buttonText = "Изменить свойства линий"
helpText = "Изменить свойства выбранных линий:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите несколько тонких или штрихпунктирных линий"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2582
def textEnglish(self):
buttonText = "Вставить знак 'Ø'"
helpText = "Вставить знак 'Ø' в размер:"+ "\n"\
"- выберите несколько размеров"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2705
def textEnglish(self):
buttonText = "Вставить знак '〼'"
helpText = "Вставить знак '〼' в размер:"+ "\n"\
"- выберите несколько размеров"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2821
def textEnglish(self):
buttonText = "Группа ортогональных проекций: установка линии разреза"
helpText = "Установить линию разреза на оси X или Y базового вида"+ "\n"\
"- выберите направление разреза"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------2956
def textEnglish(self):
buttonText = "Блокировать (разблокировать) вид
helpText = "Блокировать (разблокировать) вид"+ "\n"\
"- выберите вид"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3068
def textEnglish(self):
buttonText = "Создать вертикальную цепь размеров"
helpText = "- выберите не менее трех точек"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3186
def textEnglish(self):
buttonText = "Создать горизонтальную цепь размеров"
helpText = "- выберите не менее трех точек"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3308
def textEnglish(self):
buttonText = "Расположение вертикальной цепи размеров"
helpText = "Располагает выбранные вертикальные размеры на одной линии:"+ "\n"\
"- выберите два и более размера"+"\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3426
def textEnglish(self):
buttonText = "Расположение вертикальной цепи размеров"
helpText = "Располагает выбранные горизонтальные размеры на одной линии:"+ "\n"\
"- выберите два и более размера"+"\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3552
def textEnglish(self):
buttonText = "Вертикальные размеры"
helpText = "Величина горизонтального интервала между выбранными размерами:"+ "\n"\
"- выберите величину интервала"+ "\n"\
"- выберите два и более вертикальных размера"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3685
def textEnglish(self):
buttonText = "Горизонтальные размеры"
helpText = "Величина вертикального интервала между выбранными размерами:"+ "\n"\
"- выберите величину интервала"+ "\n"\
"- выберите две и более горизонтальных размера"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3811
def textEnglish(self):
buttonText = "Добавить разряд (max 9)"
helpText = "Добавляет разряд:"+ "\n"\
"- выберите несколько размеров"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------3937
def textEnglish(self):
buttonText = "Убрать разряд"
helpText = "Убирает разряд:"+ "\n"\
"- выберите несколько размеров"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4058
def textEnglish(self):
buttonText = "Создать горизонтальные координатные размеры"
helpText = "- выберите величину интервала"+ "\n"\
"- выберите три и более точки"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4184
def textEnglish(self):
buttonText = "Создать вертикальные координатные размеры"
helpText = "- выберите величину интервала"+ "\n"\
"- выберите три и более точки"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4320
def textEnglish(self):
buttonText = "Горизонтальный размер фаски"
helpText = "- выберите две точки"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4441
def textEnglish(self):
buttonText = "Вертикальный размер фаски"
helpText = "- выберите две точки"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4558
def textEnglish(self):
buttonText = "Создать массив отверстий"
helpText = "- выберите точку отсчета"+ "\n"\
"- выберите несколько отверстий"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------4743
def textEnglish(self):
buttonText = "Рисовать вспомогательную окружность (по центру и точке)"
helpText = "Рисовать вспомогательную окружность по двум точкам:"+ "\n"\
"- выберите свойства линии:"+ "\n"\
"- укажите центральную точку) -> затем укажите вторую (радиус)"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------5019
def textEnglish(self):
buttonText = "Рисовать вспомогательную дугу (по центру и двум точкам)"
helpText = "Рисовать дугу в положительном направлении:"+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите три точки:"+ "\n"\
"- центр, начало, конец"+ "\n"\
"- задайте радиус"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------5173
def textEnglish(self):
buttonText = "Продлить линию"
helpText = "Продлить линию с обоих концов:"+ "\n"\
"- выберите одну тонкую или осевую линию"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------5288
def textEnglish(self):
buttonText = "Укоротить линию"
helpText = "Укоротить линию с обоих концов:"+ "\n"\
"- выберите одну тонкую или осевую линию"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------5415
def textEnglish(self):
buttonText = "Создать развертку/длину дуги"
helpText = "Укажите развертку / длину дуги с помощью символа '∩':"+ "\n"\
"- выберите одну дугу"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
-------------5545
def textEnglish(self):
buttonText = "Создать перпендикулярную линию"
helpText = "Создать перпендикулярную линию через точку "+ "\n"\
"- выберите свойства линии"+ "\n"\
"- выберите одну линию"+ "\n"\
"- выберите одну точку"+ "\n"\
"- нажмите эту кнопку"
return(buttonText,helpText)
With best regards.
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
I've just discovered that I'm not able to add the dimension symbol to TechDraw_HorizontalExtentDimension. It works very well with TechDraw_HorizontalDimension.
TechDrawTools v 0.4.4
TechDrawTools v 0.4.4
Code: Select all
OS: Ubuntu 20.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.25943 (Git) AppImage
Build type: Release
Branch: master
Hash: a65464b722a846bd2999aa2fecdff1132b15b297
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
- Attachments
-
- TDTools_Diameter_Symbol_DimExtent_M4x.FCStd
- (17 KiB) Downloaded 101 times
Regards / Viele Grüße
Max
Max
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Hello
Open the macro in FC and look for the line (it should be 2643) starting with:
Code: Select all
def activated(self):
DiamSign ='Ø'
Code: Select all
if Elem.Object.TypeId == 'TechDraw::DrawViewDimExtent' or 'TechDraw::DrawViewDimension':
...
Elem.Object.FormatSpec = DiamSign+OldFormat
Code: Select all
def activated(self):
DiamSign ='Ø'
Sel = gui.Selection.getSelectionEx()
for Elem in Sel:
if Elem.Object.TypeId == 'TechDraw::DrawViewDimExtent' or 'TechDraw::DrawViewDimension':
OldFormat = Elem.Object.FormatSpec
Elem.Object.FormatSpec = DiamSign+OldFormat
A greeting
- Attachments
-
- TDTools_Diameter_Symbol_DimExtent_M4x.gif (289.63 KiB) Viewed 5809 times
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
That makes sense. Thank you!
Regards / Viele Grüße
Max
Max
Re: Macro version 4.2 multilanguage: helper tools to improve TechDraw documents.
Greetings to the Community!
Since there have been several questions, here's how you can quote (with a little patience, but not a lot) a plane axonometry in TechDraw using the tools of the "TechDrawTools V-0.4.4 multilanguage" macro.
For those wishing to try their hand at completing the sizing, acquiring practicality, in attachment, the Basic_Part_Design_Tutorial.fcstd "(revised) file used as a base.
Since there have been several questions, here's how you can quote (with a little patience, but not a lot) a plane axonometry in TechDraw using the tools of the "TechDrawTools V-0.4.4 multilanguage" macro.
For those wishing to try their hand at completing the sizing, acquiring practicality, in attachment, the Basic_Part_Design_Tutorial.fcstd "(revised) file used as a base.
- Attachments
-
- Isometric_axonometry_dimensioning.png (193.29 KiB) Viewed 4276 times
-
- Basic_Part_Design_Tutorial.fcstd
- (139.48 KiB) Downloaded 90 times
-
- axonometry_dimensioning.gif (880.94 KiB) Viewed 4276 times