Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Define Symbol Linetype

Anonymous
Not applicable
I want to create a symbol linetype in a GDL script, but the GDL manual is a bit sparse on the nature of the Macro. Can anyone post an example, preferably commented, for me to see how to do this, please?
10 REPLIES 10
Anonymous
Not applicable
I was intrigued, never done this so I thought I would have a go.

Make yourself a macro, I called mine linemacro. I just put a few lines in the 2D script so I had something to look at.

In your real object type

define symbol_line trialline linedash, linegap, linemacro parameters

!trialline is just a random name that I could use later
!linegap and linedash are parameters I put in the parameter window
!I didn't really have any parameters in linemacro so I left it blank, just
!treat it the same was as any called macro.


! remember to line_type
line_type trialline

!then draw your line, works like a charm
line2 0,0,a,0

Julia
Anonymous
Not applicable
Julia

Thanks for the reply

I see the logic of your answer, but being unfamiliar with macros, I am still not sure what the lines of code in the macro ought to be. I want to create a 'bubble'-type line (i.e comprising an end-to-end connected series of arcs) that is specific to an GDL object that I am creating. The series of arcs would probbaly only need to conatin at most three arcs.

I don't want to use the 'bubble' line type because it may not be universally available, or the user may have modified it in some way.

Could I draw my arcs and create a GDL script and therafter convert that script to a Macro?

This is intriguing - could the symbol line macro include text?
Anonymous
Not applicable
Mike,

If the line type is for use only within the library part, don't bother with the line type definition at all. It's primary purpose (as I see it) is to generate line types that can then be used in main program. The symbol line type functions are particularly quirky.

It is probably easier to just write the code as a loop:

FOR i = 1 TO line_length/(2*arc_radius)
add2 arc_radius, 0
ARC2 0, 0, arc_radius, 0, 180
add2 arc_radius, 0
NEXT i

This is probably over simplified, but I don't know your exact purpose so I'll let you worry out the details.

Another thing to keep in mind is that any attribute definitions that run inside library parts become added to the attributes of the main file. This can create some undesirable proliferation of fill types, materials, etc. But, it can also be a handy tool as well. I made some parts that I use to parametrically define brick, block and tile patterns. (I'll be making these available to everyone - but more on that later.)
Anonymous
Not applicable
Matthew wrote:
(I'll be making these available to everyone - but more on that later.)
The suspense is killing me...
Anonymous
Not applicable
Richard wrote:
Matthew wrote:
(I'll be making these available to everyone - but more on that later.)
The suspense is killing me...
I guess I'll have to do it soon then.

What's the prognosis?

I'd hate to be responsible for the untimely demise of one of our own.
Anonymous
Not applicable
Matthew

Cadsoup. eh?

Thanks for the suggestion on the lines - that is what I have done (or similar) in my script. I was rather hoping to make the line somewhat more 'universal', but I will stick with what I've got.

Of course, if it is possible to make symbol lines that contain text, I would be V. interested in developing a few of these, as we frequently use such lines in AutoCad.
Anonymous
Not applicable
MikeS wrote:
Cadsoup. eh?
Yup.
Anonymous
Not applicable
What Matthew said about using the loop is what I usually do, which is why I have never used the define line before.

A macro is no different than a normal object with maybe the exception of the subtype and unclicking the placeable box. However I have many objects that I use as macros that are usable objects in their own right. For instance I have a shower screen that is used as a macro in the shower object but can also be used by itself.

I tried putting text in but it didn't come though, which is a shame because people are always asking me if they can use text in line types and I just tell them they have to write the text with lines and circles which is a bit bothersome.
Frank Beister
Moderator
Has anyone found out, how does the scaling work? The size of the symbols in the resulting line do not have any similarity to the values of my main-object or the macro.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm