Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Other Products >>> label frame shape GDL
View previous topic :: View next topic
Author Message
PrendosJoe
New member
New member

Joined: 20 Jul 2016
Posts: 11
Location: Auckland

PostPosted: Wed Jul 27, 2016 3:01 am    Post subject: label frame shape GDL Reply with quote

Hi all,

would anyone be able to let me know how to add a triangle text frame to the following script (If this is the right section of script, and if it's possible!) please? We'd like to have a triangle keynote label where the text rotates to always be readable if possible.

[my previous similar post was moved to the 'other products' section, but I believe this is just about scripting? Apologies if I'm incorrect!]

Thanks in advance!

Code:
!Frame {
   textBlockXMin = frameMargin
   !Frame Dimensions {
      if frameIsTight then
         if mirrorText then
            xL = textBlockXMin - frameMargin
            xR = textBlockXMax + frameMargin
         else
            xL = textBlockXMin - frameMargin
            xR = textBlockXMax + frameMargin
         endif
      else
         xL = 0
         xR = frameWidthReal*glob_scale
      endif
      yB = textBlockY - frameTopMargin
      yT = 0
   !} Frame Dimensions
   if (yT - yB > 0.001) and (xR - xL > 0.001) then
      if textAlignment = 3 then
         add2 frameWidth - (xR - xL), 0
      endif
      !Edges for the Frame Polygon {
         !Rectangle {
            if frameShape = 1 then
               put xL, yB, 1,
                  xR, yB, 1,
                  xR, yT, 1,
                  xL, yT, 1
            endif
         !} Rectangle
         !Rounded Corners {
            if frameShape = 2 then
               Ri = min((yT - yB)/2 - .001, (xR - xL)/2 - .001, frameMargin*sqr(2))
               Ri = max(Ri, .00001)
               put (xL + xR)/2, yB, 1,
                  xR - Ri, yB, 1,
                  xR, yB + Ri, 1001,
                  xR, yT - Ri, 1,
                  xR - Ri, yT, 1001,
                  xL + Ri, yT, 1,
                  xL, yT - Ri, 1001,
                  xL, yB + Ri, 1,
                  xL + Ri, yB, 1001
            endif
         !} Rounded Corners
         !Hexagon {
            if frameShape = 3 then
               Ri = min((yT - yB)/2, (xR - xL)/2, frameMargin)
               put xL + Ri, yB, 1,
                  xR - Ri, yB, 1,
                  xR, (yB + yT)/2, 1,
                  xR - Ri, yT, 1,
                  xL + Ri, yT, 1,
                  xL, (yB + yT)/2, 1
            endif
         !} Hexagon
         !Cut Corners {
            if frameShape = 4 then
               Ri = min((yT - yB)/2, (xR - xL)/2, frameMargin)
               put xL + Ri, yB, 1,
                  xR - Ri, yB, 1,
                  xR, yB + Ri, 1,
                  xR, yT - Ri, 1,
                  xR - Ri, yT, 1,
                  xL + Ri, yT, 1,
                  xL, yT - Ri, 1,
                  xL, yB + Ri, 1
            endif
         !} Cut Corners
         !Vertical Line on Arrow Side {
            if frameShape = 5 then
               if label_position[2][1] > 0 then
                  put xL, yB, 0,
                     xR, yB, 1,
                     xR, yT, 0,
                     xL, yT, 0
               else
                  put xL, yB, 0,
                     xR, yB, 0,
                     xR, yT, 0,
                     xL, yT, 1
               endif
            endif
         !} Vertical Line on Arrow Side
         !Vertical Lines {
            if frameShape = 6 then
               put xL, yB, 0,
                  xR, yB, 1,
                  xR, yT, 0,
                  xL, yT, 1
            endif
         !} Vertical Lines
         !No Border {
            if frameShape = 7 then
               put xL, yB, 0,
                  xR, yB, 0,
                  xR, yT, 0,
                  xL, yT, 0
            endif
         !} No Border
      !} Edges for the Frame Polygon
      !Draw the Frame Polygon {
         if nsp then
            mask = 6
            if frameBorderPen > 0 then
               mask = mask + 1
               pen frameBorderPen
            endif
            line_type frameLineType
            fill frameFillType
            poly2_b nsp/3, mask,
               frameFillPen, frameBkgdPen,
               get(nsp)
         endif
      !} Draw the Frame Polygon
      !Selectable Edge {
         hotline2 xL, yT, xR, yT
         hotline2 xL, yB, xR, yB
         hotline2 xL, yT, xL, yB
         hotline2 xR, yT, xR, yB
      !} Selectable Edge
   endif
!} Frame

end

_________________
ArchiCAD 20 3016 NZE FULL
Windows 8.1 Pro 64-bit
Intel Xeon 3.5GHz
16GB RAM
Back to top
View user's profile Send private message    
Anton Kazmin
Junior member
Junior member

Joined: 12 Jun 2016
Posts: 131
Location: Kiev Ukraine

PostPosted: Wed Jul 27, 2016 11:33 am    Post subject: Re: label frame shape GDL Reply with quote

I think you should bring this up directly with Cadimage.
After all, you are trying to modify their commercially available product "Cadimage Keynotes" you paid for.
Licensing issues related to modification of third-party commercial products aside, they could have a solution for you.

As a note of caution, if you make modifications to Cadimage (or any other subscription based service) code directly, these modifications might get lost next time Cadimage updates their tools.

As script you posted goes, it is just part of the picture and without looking at variable names used for this GDL object, master script looked at, macros checked, there is little help you are going to have short of a vague speculation.

Most of the times, it is much easier to wright custom GDL object you need from scratch than trying to adapt large commercial product to fit your needs. Large commercial products have a lot of development inertia and might take unreasonable amount of time to implement changes if their development roadmap is mapped out for a few years ahead.

I won't, probably, be able to help you with Cadimage object modifications, but if you need some GDL objects done from scratch we can easily do that. PM me if you have questions.

_________________
Anton Kazmin
Pushing BIM since 1994
Watching ARCHICAD grow since 1987
Raising the bar for Graphisoft Hall of Fame since v.16
Back to top
View user's profile Send private message    
PrendosJoe
New member
New member

Joined: 20 Jul 2016
Posts: 11
Location: Auckland

PostPosted: Wed Jul 27, 2016 9:32 pm    Post subject: Re: label frame shape GDL Reply with quote

Thank you for the reply Anton,

I contacted Cadimage first before coming here, their response was 'No, it can't do that' and that was it. Not particularly helpful! I had hoped it would be a simple matter of adding a new frame option/ macro etc into the script that I would be able to muddle through, but it appears not.

We currently use the ArchiCAD Identification Label 19 as it's the only one we could find that can have a triangle frame, however it's not quite what we want (Ideally it would have a fill at the relevant point as in the attached image) and it doesn't link with the Cadimage Keynote Specification tool which we use, hence trying to alter the frame on the Cadimage label, rather than trying to add the Keynote script to a correct shape!

Is this something that you may be able to help with if you've time? No worries if not, and thank you for the advice in the meantime!



image1.JPG
 Description:
 Filesize:  78.33 KB
 Viewed:  121 Time(s)

image1.JPG



_________________
ArchiCAD 20 3016 NZE FULL
Windows 8.1 Pro 64-bit
Intel Xeon 3.5GHz
16GB RAM
Back to top
View user's profile Send private message    
Anton Kazmin
Junior member
Junior member

Joined: 12 Jun 2016
Posts: 131
Location: Kiev Ukraine

PostPosted: Wed Jul 27, 2016 9:52 pm    Post subject: Re: label frame shape GDL Reply with quote

PrendosJoe wrote:
Is this something that you may be able to help with?


Sure. We can certainly work a solution for you.
Lets take this in private (PM or private messaging).

_________________
Anton Kazmin
Pushing BIM since 1994
Watching ARCHICAD grow since 1987
Raising the bar for Graphisoft Hall of Fame since v.16
Back to top
View user's profile Send private message    
PrendosJoe
New member
New member

Joined: 20 Jul 2016
Posts: 11
Location: Auckland

PostPosted: Wed Jul 27, 2016 10:22 pm    Post subject: Re: label frame shape GDL Reply with quote

Thank you Anton, PM sent!
_________________
ArchiCAD 20 3016 NZE FULL
Windows 8.1 Pro 64-bit
Intel Xeon 3.5GHz
16GB RAM
Back to top
View user's profile Send private message    
PrendosJoe
New member
New member

Joined: 20 Jul 2016
Posts: 11
Location: Auckland

PostPosted: Fri Jan 13, 2017 2:54 am    Post subject: Re: label frame shape GDL Reply with quote

Apologies for the delay, but thank you for your help Anton!
_________________
ArchiCAD 20 3016 NZE FULL
Windows 8.1 Pro 64-bit
Intel Xeon 3.5GHz
16GB RAM
Back to top
View user's profile Send private message    
Anton Kazmin
Junior member
Junior member

Joined: 12 Jun 2016
Posts: 131
Location: Kiev Ukraine

PostPosted: Sat Jan 14, 2017 1:21 am    Post subject: Re: label frame shape GDL Reply with quote

PrendosJoe wrote:
Apologies for the delay, but thank you for your help Anton!


Glad I could help. You are welcome.

_________________
Anton Kazmin
Pushing BIM since 1994
Watching ARCHICAD grow since 1987
Raising the bar for Graphisoft Hall of Fame since v.16
Back to top
View user's profile Send private message    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Other Products >>> label frame shape GDL All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy