Author Topic: Reload Popup List in DCL  (Read 2219 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Reload Popup List in DCL
« on: March 15, 2016, 02:01:24 PM »
Hello  :yay!: such'm with a doubt:

Ando performing a program that is a note editor is based on a text file but my problem is this:
I have a Button that allows me to chop select text to extract the contents and save the file with a .txt extension that asu time should be updated to apresca in popup_list but as I was supposed to leave the DCL and again open to see recently is update popup_list.
Looking found a blog where a similar program I'm doing, with the difference that this has a edit_box and button to add written content, but I find with surprise that every time I give the button to add the lisp closes and reappears being updated content in popup_list. I wonder how the hell do to create a button to close and open the DCL to allow me the update on the popup_list

I am attaching the link of .vlx to be held and in advance thank you very much  :oops: :oops:


http://readytextstringsvresion-2.blogspot.ae/
« Last Edit: March 15, 2016, 05:06:50 PM by amc.dicsac »
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

kpblc

  • Bull Frog
  • Posts: 396
Re: Reload Popup List in DCL
« Reply #1 on: March 16, 2016, 01:57:41 AM »
Use (start_list <ListKey> 3) (mapcar (function add_list) <Datas>) (end_list)
Sorry for my English.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: Reload Popup List in DCL
« Reply #2 on: March 16, 2016, 05:24:08 PM »
Hi thanks just what I need

Sorry can you tell me if this code is well

Code: [Select]
(defun deleteitemlist ()
(vl-load-com)
(setq arte1 (fix arte1))
(setq arte1 (nth arte1 bloNames1)) 
(LM:RemoveNth arte1 bloNames1)
(princ))

(defun LM:RemoveNth ( n l / i )
    (setq i -1)
    (vl-remove-if '(lambda ( x ) (= (setq i (1+ i)) n)) l)
)
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

ribarm

  • Gator
  • Posts: 3308
  • Marko Ribar, architect
Re: Reload Popup List in DCL
« Reply #3 on: March 17, 2016, 12:54:12 AM »
What do you want to achieve with removing nth item from list? Shouldn't you (setq) variable and use it somewhere in calculation?

Code: [Select]
(defun deleteitemlist ( / arte1 bloNames1 bloNames2 ) ;;; - localizing used variables
;;; (vl-load-com) - no need to load VLISP extensions
  ;;; define arte1 variable - it looks from your next line that it's real positive number (initget 4) (setq arte1 (getreal)) or (initget 4) (setq arte1 (getdist))
  (setq arte1 (fix arte1))
  (setq arte1 (nth arte1 bloNames1))
  (setq bloNames2 (LM:RemoveNth (vl-position arte1 bloNames1) bloNames1)) ;;; - setqing new variable to be used later on
  ;;; ... - do your next stuff using bloNames2 variable defined previously
  (princ) ;;; - silent exit
)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

kpblc

  • Bull Frog
  • Posts: 396
Re: Reload Popup List in DCL
« Reply #4 on: March 17, 2016, 02:14:22 AM »
There is some questions: can you change code or not? Do you have source? Could you publicate it?
As an example - see attached lsp
Sorry for my English.