Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Macro variable expansion

0 votes
Hi! i am working on component diagrams and use your "beta" long macro feature. This works quite good.

No i want to add componentents and interfaces in the macro together with the macro variable.

!definelong COMP_TEXTGENCOMP(name)
  [name] << Comp >>
  interface Ifc << IfcTyoe >> AS "name Ifc"
  "name Ifc" - [name]
!enddefinelong

This gives errors, cause "name Ifc" seems not to identified as valid interface

How can i append the name macro variable? Like c syntax seems not to work: name##Ifc.

Thanks for help
asked Feb 27, 2014 by kreuzberger (250 points)

5 Answers

0 votes
found out after many tries, that it seems to work with a simple dot.
so you can use the macro for generation e.g. of components with the same interface and an "instance" handle for this interfaces.

@startuml

!definelong COMP(name)
[name]
interface TestIfc as name.TestIfc
name.TestIfc - [name]
!enddefinelong

COMP(hello)
COMP(world)

@enduml
answered Feb 27, 2014 by anonymous
0 votes

Hello,

Thanks for the suggestion.
In the following beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can use ## to concat macro arguments:
 
 @startuml
 !definelong COMP_TEXTGENCOMP(name)
 [name] << Comp >>
 interface Ifc << IfcTyoe >> AS name##Ifc
 name##Ifc - [name]
 !enddefinelong
 COMP_TEXTGENCOMP(dummy)
 @enduml


I think it is what you are looking for.

 

answered Feb 28, 2014 by plantuml (112,180 points)
0 votes
How can i find out in which release the feature from the beta will go in?

the feature with the definelong macro seems not be in the current release. So do i have to rely on the beta for this feature?
answered Feb 28, 2014 by kreuzberger (250 points)
The ## feature will be integrated in V7994, if it fits your need.

This is usually how we proceed : we publish a beta release, so that users can test it and validate that the new feature(s) is ok for them.

After their validation, we publish the official release with the feature(s).
0 votes
The solution provided worked with the betra release. So it could be added in the next release version from my point of view.

Cause the feature depends on the definelog definition (for my special case here) if also works for me to have "this feature" enabled.

This seems also not be part of the "official" release? So could you please als provide this feature?
answered Mar 3, 2014 by kreuzberger (250 points)
0 votes

This has been released in V7994.

 

@startuml
!definelong COMP_TEXTGENCOMP(name)
[name] << Comp >>
interface Ifc << IfcTyoe >> AS name##Ifc
name##Ifc - [name]
!enddefinelong
COMP_TEXTGENCOMP(dummy)
@enduml

answered Mar 3, 2014 by plantuml (112,180 points)
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...