Changing dimension with scripting

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
wakez
Posts: 2
Joined: Sat Apr 30, 2011 1:14 pm

Changing dimension with scripting

Post by wakez »

I'm still a FreeCAD beginner, but the functionality that I've seen until now is really exciting !

I am modeling the floor construction for my garage renovation project with the Python scripting. I modeled the floor layers and changed the colors with the script. I managed to indicate the width of the floor with the "makeDimension", but since the floor is quite large, the font size is too small to read. Does any one know how to change the properties of the dimension with the script ?

Thanks.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Changing dimension with scripting

Post by yorik »

yes, it's easy to do. Let's say your dimension is called "dim001":

Code: Select all

myDim = FreeCAD.ActiveDocument.dim001
myDim.ViewObject.FontSize = 0.50
wakez
Posts: 2
Joined: Sat Apr 30, 2011 1:14 pm

Re: Changing dimension with scripting

Post by wakez »

Hi Yorik,

thanks for the reply ! your suggestion worked for me.
Now I use the "makeDimension" function in the script to make an annotation, and then alter the FontSize:

Code: Select all

myDim=makeDimension(Base.Vector(0,0,0),Base.Vector(0,3570,0),Base.Vector(-400,0,0))
myDim.ViewObject.FontSize = 100
Post Reply