Author Topic: Change text in DCL dialogue from lisp file  (Read 2076 times)

0 Members and 1 Guest are viewing this topic.

sln8458

  • Newt
  • Posts: 91
  • CMS Intellicad 9.0/10.0
Change text in DCL dialogue from lisp file
« on: November 17, 2020, 07:40:35 AM »
Like the proverbial 'bad penny' I'm back :-)

Following on from here-> https://www.theswamp.org/index.php?topic=56178.msg601393#msg601393 <-

Up until now I have concentrated on the 'flanges' part of my dialogue, and have completed all of the 3D blocks.
Here is a reminder of the dialogue:-


Today I started on the fitting, specifically the 90deg long radius elbows. I created the 'dim' text files and made my first trial run.
All worked fine except, due to my poor planning (I put my hand up to this now) I realise that the text in the 'Dimensions' box is no longer relevant to the 'fittings'

Question: Is there a way I can change the text (label) in the Dimensions box via the lisp file to reflect the new selection?
Steve
There is no such  thing as a 'silly question' to those who do not know!

kozmos

  • Newt
  • Posts: 114
Re: Change text in DCL dialogue from lisp file
« Reply #1 on: November 17, 2020, 08:46:27 AM »
In DCL file, change tile type from text into text_part and give each one a key. then u can set_tile that key with new content
KozMos Inc.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Change text in DCL dialogue from lisp file
« Reply #2 on: November 17, 2020, 09:22:15 AM »
In DCL file, change tile type from text into text_part and give each one a key. then u can set_tile that key with new content
That is not necessary. You can also change text tiles from Lisp. It is labels that you cannot change at runtime.

sln8458

  • Newt
  • Posts: 91
  • CMS Intellicad 9.0/10.0
Re: Change text in DCL dialogue from lisp file
« Reply #3 on: November 17, 2020, 09:34:23 AM »
Thanks guys,

it IS the label I wanted to change

Code: [Select]
:text { label = "Flange O/D     O:";alignment=left;}
Steve
There is no such  thing as a 'silly question' to those who do not know!

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Change text in DCL dialogue from lisp file
« Reply #4 on: November 17, 2020, 09:59:45 AM »
In a DCL file you can use the value attribute or the label attribute to set the content of a text tile. AFAIK using the label attribute will add a big margin (+30%) to the right of the text. In the cases where I wanted to change a text tile at runtime I have not specified either the value or the label for the text, but only the key. You will have to try for yourself if specifying the label or the value in the DCL has an impact.

To change a text at runtime use the set_tile function:
Code: [Select]
(set_tile "tileKey" "new text")

sln8458

  • Newt
  • Posts: 91
  • CMS Intellicad 9.0/10.0
Re: Change text in DCL dialogue from lisp file
« Reply #5 on: November 17, 2020, 12:52:00 PM »
Thanks Roy,

Just back from my daily walk, Dr orders!!
While out I got to thinking along those lines, ie remove the label & add a 'key'

I'll have a play tomorrow, see how it goes and post back.

S.
There is no such  thing as a 'silly question' to those who do not know!

sln8458

  • Newt
  • Posts: 91
  • CMS Intellicad 9.0/10.0
Re: Change text in DCL dialogue from lisp file
« Reply #6 on: November 18, 2020, 04:53:44 AM »
A quick update:

I have got Roy_043 suggestion working :)

For anyone else reading here is a snippet of my changes:

Original DCL
Code: [Select]

            :row {
:text { label = "Flange O/D     O:";alignment=left;}
:text { key = "n1";alignment=right;}
}

Revised DCL
Code: [Select]

          :row {
:text { key = "labeln1";alignment=left;}
:text { key = "n1";alignment=right;}
}

Original LSP
Code: [Select]
(defun RB11_FLAG ()
(setq flg "wn_") ;store flange type
);end rb11_flag


Revised LSP
Code: [Select]
(defun RB11_FLAG ()
(setq flg "wn_") ;store flange type
(set_tile "labeln1" "Flange O/D O:")
);end rb11_flag

S.
There is no such  thing as a 'silly question' to those who do not know!