BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Trees (and other objects) Fill-Type not Gradient Enabled

ares997
Contributor
I'm trying to make some fancy trees with a gradient fill in them but can't really see why they can't be gradient nor where to adjust the code to make them gradient....so this is a stock ac14 trees' 2d script (out of the box):


***
unID = 1
pen gs_cont_pen

if type=`Simple` then

hotspot2 0, 0
hotspot2 a/2, 0
hotspot2 -a/2, 0
hotspot2 0, b/2
hotspot2 0, -b/2

circle2 0,0, a/2
circle2 0,0, diaTrunk/2

fill gs_fill_type

poly2_b 2, 2, gs_fill_pen, gs_back_pen,
0,0,900,
a/2,360,4000

else

for iType = 1 to 40
if stSymbolType[iType] = type then
macroName = stSymbolMacroName[iType]
call macroName parameters a=a, b=b,type=stSymbolInMacroType[iType], cont_pen=gs_cont_pen,
fill_type=gs_fill_type, f_pen=gs_fill_pen, b_pen=gs_back_pen
endif
next iType

endif

! ==============================================================================
! TEXT
! ======================================================================
nTrans = 0
if txt_show then

hotspot2 txt_pos_x, 0, UnID, txt_pos_y, 1+128 : unID=unID+1
hotspot2 txt_pos_x, -1, UnID, txt_pos_y, 3 : unID=unID+1
hotspot2 txt_pos_x, txt_pos_y, UnID, txt_pos_y, 2 : unID=unID+1

hotspot2 0, txt_pos_y, UnID, txt_pos_x, 1+128 : unID=unID+1
hotspot2 -1, txt_pos_y, UnID, txt_pos_x, 3 : unID=unID+1
hotspot2 txt_pos_x, txt_pos_y, UnID, txt_pos_x, 2 : unID=unID+1

pen txt_pen

define style fe1 fontType, fontSizeFixed_mm, 5, isBold + isItalic * 2 + isUnderlined * 4
style fe1
add2 txt_pos_x, txt_pos_y
nTrans = nTrans + 1

! --- Oriented View ------------------------------ [

angleViewRot = 0
rrr = REQUEST ("View_Rotangle", "", angleViewRot)
totalRotate = (SYMB_ROTANGLE + angleViewRot) MOD 360

! Text Rotation - Readable / Always Horizontal / Align with Symbol
! ----------------------------------------------------------------------
if typeTextRotation_m = 2 then ! Readable
if (totalRotate > (gs_readable_angle + eps) & totalRotate < (gs_readable_angle + 180 + eps)) then
rot2 180
nTrans = nTrans + 1
endif
else
if typeTextRotation_m = 1 then ! Horizontal
rot2 totalRotate * (SYMB_MIRRORED - not(SYMB_MIRRORED)) ! 1/-1
nTrans = nTrans + 1
endif
endif
! ----------------------------------------------------------------------

text2 0,0,txt
del nTrans
endif

! ==============================================================================
end
! ==============================================================================

call "tree_2D-01" parameters all
call "tree_2D-02" parameters all
call "tree_2D-03" parameters all
call "tree_2D-04" parameters all
call "tree_2D-05" parameters all
call "tree_2D-06" parameters all
call "tree_2D-07" parameters all
call "tree_2D-08" parameters all
call "tree_2D-09" parameters all
call "tree_2D-10" parameters all
call "tree_2D-11" parameters all
***


But when I go to the variable for the Fill type in the parameters the variable doesn't have an option for gradient.

All suggestions
Archicad 25 (5005), Windows 11, AMD RYZEN 7 3900 (64 GB RAM)
1 REPLY 1
Pertti Paasky
Expert
ares997,

Try to replace
poly2_b 2, 2, gs_fill_pen, gs_back_pen,
0,0,900,
a/2,360,4000

with this:

set fill gs_fill_type !or [set fill "gradient fill"] (check the name, please)
poly2_b{5} 2, 3, 0, 12,
gs_fill_pen, gs_back_pen,

0, .3,
1, 0, 0, 1,
0.3,

0,0,900,
a/2,360,4000

check details GDL Reference quide page 150 (AC !3)

You can also draw Your tree 2d in plan wiew and then drag it into an object´s 2d program window. Then You can copy the code into Your object.
poly2_b{5} has lots of controll flags, be patient...by adjusting them You get what You want.

If You can´t get the gradient fill from the dialog box, just write it like You get it from dragging it in the 2d window
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!