Drawing Dimensioning

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!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Drawing Dimensioning

Postby NormandC » Sat Feb 14, 2015 10:22 pm

Did you do this with hamish's Drawing Dimensioning module Mario?
mario52
Posts: 2925
Joined: Wed May 16, 2012 2:13 pm

Re: Drawing Dimensioning

Postby mario52 » Sun Feb 15, 2015 1:35 am

hi
no with vectorcad
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Drawing Dimensioning

Postby NormandC » Sun Feb 15, 2015 2:27 am

I kind of figured as much since it looked nothing like FreeCAD.

But then what help is it to us here? :?:

Also it proves my point.
jmaustpc
Posts: 9639
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Drawing Dimensioning

Postby jmaustpc » Sun Feb 15, 2015 9:13 am

Sergey_r wrote:Can I make dimensions automatically for each of the detais in project? I would like to make project and automatically print each of the detais.
What you can do in FreeCAD currently is link a Draft Dimension to a single edge or circle/arc, insert that into a Drawing, then it will update automatically if you changed the length/radius/diameter. This has its limitations and is not what you asked about but may in some cases reduce your work load.
mario52
Posts: 2925
Joined: Wed May 16, 2012 2:13 pm

Re: Drawing Dimensioning

Postby mario52 » Sun Feb 15, 2015 2:48 pm

hi
just a visual example dimensioning automatic in agreement with you
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

Re: Drawing Dimensioning

Postby YCStone_ » Mon Jun 27, 2016 7:53 am

mario52 wrote:hi
here on example dimensioning automatic with 24 objects (include points and axis)
CotationAuto00.png
mario

Hi Mario
can you pls elaborate how did you achieve the automatic dimensioning??
thankx
YC Stone Natural Stone Supplier
mario52
Posts: 2925
Joined: Wed May 16, 2012 2:13 pm

Re: Drawing Dimensioning

Postby mario52 » Mon Jun 27, 2016 12:10 pm

hi
with Vcad (VectorCad) http://www.vectorcam.com/ (my version 1.0 June 1993) (Does not work with Windows 10)
images

but it is easy to make a macro (here an example just an example to play and see !!)
create a box and run

Code: Select all

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import FreeCAD,Draft

sel = FreeCADGui.Selection.getSelection()                                 # select object with getSelection()
i = 0
for j in enumerate(sel[0].Shape.Edges):                                   # list all Edges
    i += 1
    App.Console.PrintMessage("Edges n : "+str(i)+"\n")
    a = sel[0].Shape.Edges[j[0]].Vertexes[0]
    App.Console.PrintMessage("X1           : "+str(a.Point.x)+"\n")       # coordinate XYZ first point
    App.Console.PrintMessage("Y1           : "+str(a.Point.y)+"\n")
    App.Console.PrintMessage("Z1           : "+str(a.Point.z)+"\n")

    X1 = a.Point.x     # coordinate XYZ first point
    Y1 = a.Point.y
    Z1 = a.Point.z
    cotBegin = FreeCAD.Vector(X1,Y1,Z1)
    try:
        a = sel[0].Shape.Edges[j[0]].Vertexes[1]
        App.Console.PrintMessage("X2           : "+str(a.Point.x)+"\n")   # coordinate XYZ second point
        App.Console.PrintMessage("Y2           : "+str(a.Point.y)+"\n")
        App.Console.PrintMessage("Z2           : "+str(a.Point.z)+"\n")
        X2 = a.Point.x     # coordinate XYZ first point
        Y2 = a.Point.y
        Z2 = a.Point.z
        cotEnd = FreeCAD.Vector(X2,Y2,Z2)

    except:
        App.Console.PrintMessage("Oups"+"\n\n")
#    else:

    distance = FreeCAD.Vector(20.0,0.0,0.0)
    Cotation = Draft.makeDimension (cotBegin,cotEnd,distance)
    FreeCADGui.ActiveDocument.getObject(Cotation.Name).ArrowSize = '2 mm'

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

Re: Drawing Dimensioning

Postby YCStone_ » Mon Jun 27, 2016 12:14 pm

mario52 wrote:hi
with Vcad (VectorCad) http://www.vectorcam.com/ (my version 1.0 June 1993) (Does not work with Windows 10)
images

but it is easy to make a macro (here an example just an example to play and see !!)
create a box and run

Code: Select all

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import FreeCAD,Draft

sel = FreeCADGui.Selection.getSelection()                                 # select object with getSelection()
i = 0
for j in enumerate(sel[0].Shape.Edges):                                   # list all Edges
    i += 1
    App.Console.PrintMessage("Edges n : "+str(i)+"\n")
    a = sel[0].Shape.Edges[j[0]].Vertexes[0]
    App.Console.PrintMessage("X1           : "+str(a.Point.x)+"\n")       # coordinate XYZ first point
    App.Console.PrintMessage("Y1           : "+str(a.Point.y)+"\n")
    App.Console.PrintMessage("Z1           : "+str(a.Point.z)+"\n")

    X1 = a.Point.x     # coordinate XYZ first point
    Y1 = a.Point.y
    Z1 = a.Point.z
    cotBegin = FreeCAD.Vector(X1,Y1,Z1)
    try:
        a = sel[0].Shape.Edges[j[0]].Vertexes[1]
        App.Console.PrintMessage("X2           : "+str(a.Point.x)+"\n")   # coordinate XYZ second point
        App.Console.PrintMessage("Y2           : "+str(a.Point.y)+"\n")
        App.Console.PrintMessage("Z2           : "+str(a.Point.z)+"\n")
        X2 = a.Point.x     # coordinate XYZ first point
        Y2 = a.Point.y
        Z2 = a.Point.z
        cotEnd = FreeCAD.Vector(X2,Y2,Z2)

    except:
        App.Console.PrintMessage("Oups"+"\n\n")
#    else:

    distance = FreeCAD.Vector(20.0,0.0,0.0)
    Cotation = Draft.makeDimension (cotBegin,cotEnd,distance)
    FreeCADGui.ActiveDocument.getObject(Cotation.Name).ArrowSize = '2 mm'

mario
wow thank you somuch Mario
ill check it tomorrow, its getting late here
thanks
YC Stone Natural Stone Supplier