Menu

Drawj2d releases 1.3.x

2021-10-04
2024-03-03
  • A. Vontobel

    A. Vontobel - 2021-10-04

    Please use this forum topic for comments about these releases.

     
  • Stefan Blixten Karlsson

    Is there a way to access environment variables from HCL ?

     
    • A. Vontobel

      A. Vontobel - 2023-01-24

      Short answer: You cannot access environment variables directly.

      There are a few ways to pass parameters to drawj2d in order to access them from the hcl script:
      1. source someinput.hcl
      2. read data from file: open
      3. system.getproperty user.dir gives access to some system properties, e.g. the user working directory. Get the complete list in jshell:
      System.getProperties().forEach((key, value) -> System.out.println(key + ": " + value));`
      4. $argv gives access to the list of command line arguments, passed to the drawing script

      Long answer : drawj2d accessEnv.hcl "$(env)"
      It is valid for Linux (and probably Mac) and uses way number 4.

      accessEnv.hcl

      if {< $argc 1} {
          puts {USAGE: }
          puts {drawj2d accessEnv.hcl "$(env)"}
          exit 1
      }
      set envList [split [lindex $argv 0] \n]
      
      puts "Number of variables: [llength $envList]"
      # foreach entry [sort $envList] {
      #   puts $entry 
      # }
      
      set item LANG
      set value {}
      foreach entry $envList {
          set index [strfind ${item}= $entry]
          if {= $index 0} {
              set value [strtriml $entry ${item}=]
              break
          }
      }
      puts "environment variable $item is: $value"
      

      may return:
      Number of variables: 99
      environment variable LANG is: de_CH.UTF-8

      The complete list of the available commands is printed in the drawj2d function reference. The hecl commands are documented on the hecl website.

       
  • Stefan Blixten Karlsson

    Thanks for you quick answer and list of options. I now think I know how to proceed.

     
  • Anonymous

    Anonymous - 2023-03-08

    I have two questions regarding the font "Lines".

    1. Is it possible to used it monospaced?
    2. Is it possible to change the width os the lines used?
     
    • A. Vontobel

      A. Vontobel - 2023-04-08
      1. A Monospaced Lines font would have to be added. I will have to look at it to see, if it can be implemented with a reasonable effort.

      2. The stroke with of the letters is hard coded. It is related to the font size (but not linearly).
        The width of the text block can be changed, see program documentation.

       
      • A. Vontobel

        A. Vontobel - 2023-04-13

        have added to font LinesMono. It currently is just the single line font Lines monospaced.

        There is no new release yet. If you want to test it, you'll need to download the source code and run ant to compile the program (requires JDK and Apache Ant).

         
        • A. Vontobel

          A. Vontobel - 2023-05-24

          Released in 1.3.2

           
  • Anonymous

    Anonymous - 2023-11-04

    Hello, newbie here. I must miss something obvious, so please excuse my ignorance:
    using command prompt (or PowerShell), I can cd to the directory where I unzipped Drawj2d files. I launch by typing "drawj2d" (without the quotes of course).
    I get the welcome prompt (with wopyright and version 1.32). Mode says: Freehep
    Problem: when typing the example prompt: ''drawj2d -T svg -W 100 -H 60 drawing.hcl'' nothing happens...
    drawing.hcl contains the prompted input: (# variables set dx 50 etc. etc.)
    What am I doing wrong?
    Thanks

     
    • A. Vontobel

      A. Vontobel - 2024-03-03

      Have you tried to type drawj2d -T svg -W 100 -H 60 drawing.hcl immediately (not testing "drawj2d" before)?

       
  • Anonymous

    Anonymous - 2024-01-25

    A. Vontobel,

    Would you customise this library for generating some enclosure drawings? We will pay you. If you are interested please contact yashodhan.joshi@gmail.com

     
    • A. Vontobel

      A. Vontobel - 2024-03-03

      Personally I am not interested, but thanks for asking.

      Drawj2d is is free software, subject to the GPL. The license allows the modification of the software, you just have to grant the users the same rights when redistributing the modified version (e.g. give them the source code). Thus you may ask any programmer to customize the software.

      By the way, chances are that you can create customized drawings without modifying the drawj2d program. The hcl input files are "scriptable". Have a look at the manual, chapter "Programming commands". Again, you may ask any programmer (hcl is similar to the widely known TCL Tool Command Language).

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.