Author Topic: List manipulation (dcl list_box)  (Read 4648 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Swamp Rat
  • Posts: 637
Re: List manipulation (dcl list_box)
« Reply #15 on: February 01, 2013, 07:28:39 PM »
This program would be great if done with OpenDCL..
 

hi togores.
i agree. it shouldn't be problem to translate to odcl. but first we need lisp version.
kruuger

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: List manipulation (dcl list_box)
« Reply #16 on: February 02, 2013, 08:19:22 AM »
OK, here's the spoon fed version  ;)

Notice I've implemented each step in generating the data from a DWG as a separate defun. This is the usual mantra in Lisp: A function should do only one thing and not try to be everything to everyone. This allows for reusing the function in many different places for different purposes by simply calling that function. I.e. the defuns build on each others' results instead of making one huge defun which generates all the data in one go.

Thus with minimal effort this could be extended to include Dynamic Block Parameters as well by simply adding a few defuns, adding some calls to them and adjusting the data list's structure a bit.

But mainly the most important idea is how you structure the data list. Notice my code reads the file into the list, then closes the file. Only then does it redisplay the dialog from that data list. This is usually a good idea, since you're not locking the file down by simply viewing it. Allows others to work on the file and minimizes the chances of corruption.

Main point I'm trying to make in this is the use of nth with the index obtained from $value / get_tile. Notice these in the last c:BlockBrowser defun's action defuns.
« Last Edit: February 02, 2013, 08:22:48 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

kruuger

  • Swamp Rat
  • Posts: 637
Re: List manipulation (dcl list_box)
« Reply #17 on: February 02, 2013, 02:29:11 PM »
OK, here's the spoon fed version  ;)

Notice I've implemented each step in generating the data from a DWG as a separate defun. This is the usual mantra in Lisp: A function should do only one thing and not try to be everything to everyone. This allows for reusing the function in many different places for different purposes by simply calling that function. I.e. the defuns build on each others' results instead of making one huge defun which generates all the data in one go.

Thus with minimal effort this could be extended to include Dynamic Block Parameters as well by simply adding a few defuns, adding some calls to them and adjusting the data list's structure a bit.

But mainly the most important idea is how you structure the data list. Notice my code reads the file into the list, then closes the file. Only then does it redisplay the dialog from that data list. This is usually a good idea, since you're not locking the file down by simply viewing it. Allows others to work on the file and minimizes the chances of corruption.

Main point I'm trying to make in this is the use of nth with the index obtained from $value / get_tile. Notice these in the last c:BlockBrowser defun's action defuns.

many thanks irneb. for sure i will review your code and see what i can use in my program :)

kruuger

Bhull1985

  • Guest
Re: List manipulation (dcl list_box)
« Reply #18 on: September 09, 2013, 09:01:25 AM »
Hey Irneb, I dug into the swamp forums for a while as well as other forums to locate a dcl / lisp that would be similar to this one.
I have a few minor (or not so minor) requests that I would like your help in accomplishing in regards to this dcl / lisp.
Can we add a row under the "Drawings:" column that would be a preview of the block images that are selected in the middle column?
And then for the "okay" button , currently it is set to (princ "Do some stuff if OK is pressed") so, was wondering if we could maybe have the okay button when an attribute is selected from the list of attributes on the furthest right column of the blocks to simply edit that attribute? That would be fairly handy, an alternative way to edit some of these blocks, via this lisp / dcl to tag valves, etc....there are some uses we could derive from something similar to this with these edits, if they would at all be possible to accomplish.

Thanks!

Bhull1985

  • Guest
Re: List manipulation (dcl list_box)
« Reply #19 on: September 09, 2013, 09:08:19 AM »
I'll be attempting these tasks today , but would hope to see a post from you in case I have questions I'll have a place to ask them.
*crosses fingers*!