This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all objects | |
# -*- coding: utf-8 -*- | |
import FreeCAD,Draft | |
# List all objects of the document | |
doc = FreeCAD.ActiveDocument | |
objs = FreeCAD.ActiveDocument.Objects | |
def clearConsole(): | |
from PySide import QtGui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all objects | |
# -*- coding: utf-8 -*- | |
import FreeCAD,Draft | |
# List all objects of the document | |
doc = FreeCAD.ActiveDocument | |
objs = FreeCAD.ActiveDocument.Objects | |
#App.Console.PrintMessage(str(objs) + "\n") | |
#App.Console.PrintMessage(str(len(FreeCAD.ActiveDocument.Objects)) + " Objects" + "\n") | |
def clearConsole(): | |
from PySide import QtGui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import matplotlib.pyplot as plt | |
import winreg | |
# Obtener la lista de fuentes disponibles en el Registro de Windows | |
fonts_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", 0, winreg.KEY_READ) | |
font_names = [winreg.EnumValue(fonts_key, i)[0] for i in range(winreg.QueryInfoKey(fonts_key)[1])] | |
#Pause here to wait for loading if not I have an error finding fonts | |
code = """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TestDictionary | |
{ | |
/* | |
Test for 100 iterations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(byte Min, byte Value, byte Max,byte speed, bool Increasing) TextSize; | |
(byte Min, byte Value , byte Max, byte speed, bool Increasing) Red; | |
(byte Min, byte Value, byte Max, byte speed, bool Increasing) Green; | |
(byte Min, byte Value, byte Max, byte speed, bool Increasing) Blue; | |
Random dice = new Random(); | |
SKPaint textpaint; | |
private void Init() | |
{ | |
TextSize = (10, 128, 200,1, true); | |
Red = (0, (byte)dice.Next(0, 128), 200, (byte)dice.Next(0, 5), true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListDictionaryConverter<T> : JsonConverter where T : Entity | |
{ | |
public override bool CanConvert(Type objectType) | |
{ | |
return (objectType == typeof(object)); | |
} | |
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) | |
{ | |
Dictionary<string, T> result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
enum {NON_EXISTING, LOAD_SUCCESS, LOAD_ERROR_COULDNT_OPEN} | |
const SAVE_PATH = "user://config.cfg" | |
var _config_file = ConfigFile.new() | |
func _ready(): | |
var result = load_settings() | |
if result == NON_EXISTING: | |
SetDefault() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Remember to RaisePropertyChanged the ZIndex when Size Changes in the Model--> | |
<!-- And the viewmodel is defined like the following: | |
<Application.Resources> | |
<vm:PackViewModel x:Key="PackViewModel"/> | |
... | |
--> | |
<Grid Opacity="0.7" SnapsToDevicePixels="False" x:Name="ObjectZIndex" Visibility="{Binding IsZIndexSelector, Converter={StaticResource BoolVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent" Width="{Binding ElementName=BackPanel, Path=ActualWidth}" Height="1" RenderTransformOrigin="0,0"> | |
<Grid.Resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ZIndexConverter : DependencyObject, IValueConverter | |
{ | |
public string Size | |
{ | |
get { return (string)GetValue(SizeProperty); } | |
set { SetValue(SizeProperty, value); } | |
} | |
public static readonly DependencyProperty SizeProperty = | |
DependencyProperty.Register(nameof(Size), typeof(string), typeof(ZIndexConverter), new PropertyMetadata("0,0",OnSizeChanged)); |
NewerOlder