<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Composite Skin Label for Core Material Only in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322743#M2273</link>
    <description>&lt;P&gt;You need to run a loop:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DIM elemBMatData[] : k=1&amp;nbsp;&lt;BR /&gt;FOR i=1 TO&amp;nbsp;WALL_SKINS_NUMBER&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF&amp;nbsp;WALL_SKINS_PARAMS[i][6]&amp;gt;0 THEN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elemBMatData[k]=WALL_SKINS_BMAT_NAMES[i] : k=k+1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ENDIF&lt;BR /&gt;NEXT i&amp;nbsp;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Nov 2021 21:05:35 GMT</pubDate>
    <dc:creator>Podolsky</dc:creator>
    <dc:date>2021-11-26T21:05:35Z</dc:date>
    <item>
      <title>Composite Skin Label for Core Material Only</title>
      <link>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322711#M2272</link>
      <description>&lt;P&gt;Hello, I am trying to write a GDL script for a composite Skin label that will only list the core material name.&lt;/P&gt;&lt;P&gt;I am running into problems with the below IF statement.&amp;nbsp; It should be "If the wall_skins_params skin status is 1 then my variable 'elemBMATData'&amp;nbsp; is the same value as the global variable 'wall_skins_bMat_names'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF wall_skins_params [thisSkin][6] = 1 THEN&lt;BR /&gt;&amp;nbsp;elemBMatData = wall_skins_bMat_names&lt;BR /&gt;ENDIF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone offer advice on why this doesn't work ?&lt;/P&gt;&lt;P&gt;The next steps will be to write a script that only returns values for the finish skin status materials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-I'm running Archicad 25 on a windows 10 computer.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 08:41:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322711#M2272</guid>
      <dc:creator>sikho</dc:creator>
      <dc:date>2021-11-23T08:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Skin Label for Core Material Only</title>
      <link>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322743#M2273</link>
      <description>&lt;P&gt;You need to run a loop:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DIM elemBMatData[] : k=1&amp;nbsp;&lt;BR /&gt;FOR i=1 TO&amp;nbsp;WALL_SKINS_NUMBER&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF&amp;nbsp;WALL_SKINS_PARAMS[i][6]&amp;gt;0 THEN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elemBMatData[k]=WALL_SKINS_BMAT_NAMES[i] : k=k+1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ENDIF&lt;BR /&gt;NEXT i&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Nov 2021 21:05:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322743#M2273</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-11-26T21:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Skin Label for Core Material Only</title>
      <link>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322927#M2274</link>
      <description>&lt;P&gt;That's excellent. Thank you Podolsky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For anyone else who is interested, I've posted the working code below. Copy and paste into the 2D window of the GDL Editor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GOSUB "BuildingElement - getCompositeData" !Go to the subroutine that gets the skin names from the building element
GOSUB "CompositeData - draw2D" !Go to the subroutie that creates the actual label on the drawing
END !You're done, nice job.



!--------------------------------------------------------------------------------------------------------------------------------------
!This is the subroutine that creates the actual label on the drawing
!-----------

"CompositeData - draw2D":
GOSUB "CompositeData - defineStyle" !Go to the subroutine that creates the style of the label
GOSUB "CompositeData - getDimensionFormat" !Go to the subroutine that sets the dimension for the label
columnWidth = columnWidth*glob_scale/1000
FOR thisSkin = 1 to elemSkinN !This is the start of a loop that sets up the amount of rows needed based on the number of skins
GOSUB "CompositeData - drawSkinFillText" !Go to the subroutine that inputs the text for the label
textY = textY - lineSpacing
NEXT thisSkin !Looping back around now
RETURN !...and you're done.


!These are the subroutines referenced above:

"CompositeData - defineStyle":
dataTextStyle = 1*dataTextBold + 2*dataTextItalics + 4*dataTextUnderlined
define style "Data Left" dataTextFont, dataTextHeight, 1, dataTextStyle
define style "Data Right" dataTextFont, dataTextHeight, 3, dataTextStyle
lineSpacing = 0 : rrr = request("Height_of_Style", "Data Left", lineSpacing)
lineSpacing = lineSpacing*glob_scale/1000
RETURN

"CompositeData - getDimensionFormat":
linearDimensionFormat = "" : rrr = request("Linear_Dimension", "", linearDimensionFormat)
RETURN

"CompositeData - drawSkinFillText":
skinName = elemBMatData [thisSkin] [1]
style "Data Left"
text2 columnWidth , textY, skinName
RETURN


!-----------
!That's it for creating the actual label, the next part is getting the skin names from the building elements
!=======================================================================================================================================



!--------------------------------------------------------------------------------------------------------------------------------------
!This is the subroutine that gets the skins element from the building element
!-----------

!First we need to figure out what type of building element the label is for and then go to the right part of our code:

"BuildingElement - getCompositeData":
IF (glob_elem_type = eElemTypeWall) THEN GOSUB "Wall - getCompositeData"
IF (glob_elem_type = eElemTypeRoof) THEN GOSUB "Roof - getCompositeData"
IF (glob_elem_type = eElemTypeSlab) THEN GOSUB "Slab - getCompositeData"
RETURN


! To get the skin name from cmposite walls we need:

"Wall - getCompositeData":
elemSkinN =0
FOR i=1 TO WALL_SKINS_NUMBER
IF WALL_SKINS_PARAMS [i] [6] &amp;gt;0 THEN
elemSkinN = elemSkinN +1
ENDIF
NEXT i

DIM elemBMatData[][] : k=1
FOR i=1 TO WALL_SKINS_NUMBER
IF WALL_SKINS_PARAMS[i][6]&amp;gt;0 THEN
elemBMatData[k]=WALL_SKINS_BMAT_NAMES[i] : k=k+1
ENDIf
NEXT i
RETURN


! To get the skin name from cmposite roofs we need:


"Roof - getCompositeData":
elemSkinN =0
FOR i=1 TO ROOF_SKINS_NUMBER
IF ROOF_SKINS_PARAMS [i] [6] &amp;gt;0 THEN
elemSkinN = elemSkinN +1
ENDIF
NEXT i

DIM elemBMatData[][] : k=1
FOR i=1 TO ROOF_SKINS_NUMBER
IF ROOF_SKINS_PARAMS[i][6]&amp;gt;0 THEN
elemBMatData[k]=ROOF_SKINS_BMAT_NAMES[i] : k=k+1
ENDIf
NEXT i
RETURN


! To get the skin name from cmposite slabs we need:

"Slab - getCompositeData":
elemSkinN =0
FOR i=1 TO SLAB_SKINS_NUMBER
IF SLAB_SKINS_PARAMS [i] [6] &amp;gt;0 THEN
elemSkinN = elemSkinN +1
ENDIF
NEXT i

DIM elemBMatData[][] : k=1
FOR i=1 TO SLAB_SKINS_NUMBER
IF SLAB_SKINS_PARAMS[i][6]&amp;gt;0 THEN
elemBMatData[k]=SLAB_SKINS_BMAT_NAMES[i] : k=k+1
ENDIf
NEXT i
RETURN

!-----------







And copy and paste this into the Master window:

true = 1
false = 0
eps = 0.0001

!Element Types Enumerator
i = 0 : eElemTypeNone = i
i = 1 : eElemTypeNone = i
i = 2 : eElemTypeObject = i
i = 3 : eElemTypeWindow = i
i = 4 : eElemTypeDoor = i
i = 5 : eElemTypeWall = i
i = 6 : eElemTypeColumn = i
i = 7 : eElemTypeSlab = i
i = 8 : eElemTypeRoof = i
i = 9 : eElemTypeFill = i
i = 10 : eElemTypeMesh = i
i = 11 : eElemTypeZone = i
i = 12 : eElemTypeBeam = i
i = 13 : eElemTypeCWWall = i
i = 14 : eElemTypeCWFrame = i
i = 15 : eElemTypeCWPanel = i
i = 16 : eElemTypeCWJunction = i
i = 17 : eElemTypeCWAccessory = i
i = 18 : eElemTypeShell = i
i = 19 : eElemTypeSkylight = i
i = 20 : eElemTypeMorph = i

!Skin Data Enumerator
i = 1 : eSkinDataFill = i
i = 2 : eSkinDataThick = i
!There is a lot more data available but we only need the first two for this label

dim elemSkinData[][],
elemBMatData[][]

elemSkinN = 0
elemBMatData[1][1] = ""


textY = 0&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 21:07:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Composite-Skin-Label-for-Core-Material-Only/m-p/322927#M2274</guid>
      <dc:creator>sikho</dc:creator>
      <dc:date>2021-11-26T21:07:01Z</dc:date>
    </item>
  </channel>
</rss>

