Search found 327 matches

by chakkree
Sat Jul 04, 2020 5:28 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

In Command2d Property. If not assign color=(r,g,b),it will be use base color property in view tab. I think HATCH should have some parameter to assign hatch gap's width Line; 0,0; W1, 0 Line; 0,t1; W1, t1 Line; 0,t1+t2; W1, t1+t2 Line; 0,t1+t2+t3; W1, t1+t2+t3 H; 0, 0 ; W1, t1; color=(1,1,0) ; width=...
by chakkree
Sat Jul 04, 2020 5:19 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

For external wall, could I have two color parameters, one red for brick, one yellow for timber? ext.jpg Command2d Property: Line; 0,0; W1, 0 Line; 0,t1; W1, t1 Line; 0,t1+t2; W1, t1+t2 Line; 0,t1+t2+t3; W1, t1+t2+t3 H; 0, 0 ; W1, t1; color=(1,1,0) ; width=3 Variables Property: W1:1000 # Length of W...
by chakkree
Sat Jul 04, 2020 2:49 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

*** Not complete!, for test only. :D unzip CAD2D.zip to FreeCAD.0,19.21xxx/Mod/ create CAD2D object by Python console from CAD2D_Object import makeCAD2D makeCAD2D() Edit "Command2d" Property for Line command test. # Line; x1,y1; x2,y2; [width=2] ; [color=(1,0,0)] ; [style=DASHED|DASHDOT|DO...
by chakkree
Wed Jul 01, 2020 5:20 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

CAD2D object (pivy.coin.) Command2d now can draw only a line, but line command can assign width, color , linePattern. Basic geometry command : line; x1,y1; x2,y2; [width=2] ; [color=(0,0,0)] ; [style=solid|dashed|dotted|dashdot] ; scale=1 Line Command Example: L;0,0;W,W ; width=1 ; color=(0.,0.,1) #...
by chakkree
Wed Jul 01, 2020 1:54 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

johnwang wrote: Wed Jul 01, 2020 1:11 am Cool. Is there an inventor viewer if I save this?
If save IV string to text file in .iv extension.
I use FreeCAD for view an inventor file.

file "duck.iv" download form link then drag and drop to FreeCAD.
https://github.com/coin3d/pivy/tree/mas ... les/Mentor

Duck_IV.png
Duck_IV.png (289.6 KiB) Viewed 1621 times
by chakkree
Tue Jun 30, 2020 3:39 pm
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

Next step: Inherit CAD2D object form DraftObject. Check linePattern , for example, style.linePattern = 0xff9c # Center create another Command2d(Rectangle,Circle,) Assign color variable to each command. +++ Trick: use this code for check node of inventor. line = FreeCADGui.Selection.getSelection()[0]...
by chakkree
Tue Jun 30, 2020 2:10 pm
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

Re-design CAD2D object to pivy.coin.
First test concept:
  • now, cannot change color
  • Command2d, can use only "L;x1,y1;x2,y2"
It's very hard way. :lol:

CAD2D_COIN_01_Proto.png
CAD2D_COIN_01_Proto.png (266.73 KiB) Viewed 1588 times
by chakkree
Tue Jun 30, 2020 7:45 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

I gave a quick look at the code as I was really curious. Looks like you are drawing every hatch line as an Edge. This doesn't look the good approach to me: you will have a lot of unuseful Part Shapes in your document, making the file too heavy too quick. Draft workbench objects have the possibility...
by chakkree
Tue Jun 30, 2020 4:45 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

Needs more wall types: External wall and Internal wall. External wall : 230 brick wall, brick-veneer wall (110 brick + gap (40 or 50) + timber frame (90 or 70) Internal wall : timber frame (90 or 70) Could you fill a rectangle with solid? 1) Do you have sample image or dxf file? 2) I'm think it can...
by chakkree
Tue Jun 30, 2020 2:53 am
Forum: Draft, Arch & BIM
Topic: Graphic2D Object with mini script and variable
Replies: 48
Views: 9408

Re: Graphic2D Object with mini script and varriable

How did you obtain the hatches and the dashed lines? 1) Hatch pattern have only 2 patterns(ANSI31, ANSI32) and hatch in only rectangular boundary. H; x,y; w,h ; pattern -> etc H; 0,0 ; 200,500 ; ANSI31 H; 300,0 ; 200,500 ; ANSI31 CAD2D_11_TestHatch.png 2) The dashed line assign by array [line , bla...