Author Topic: set layer current function  (Read 5777 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
set layer current function
« on: August 10, 2012, 03:34:58 AM »
Hi !

Can somebody help mer where can I build in function xxx to set layer current when I choice layer from listbox

Regards Dirk

owenwengerd

  • Bull Frog
  • Posts: 451
Re: set layer current function
« Reply #1 on: August 10, 2012, 05:52:53 AM »
You can do it in your OnSelChanged event handler, but you need to set the list box Event Invoke property to Asynchronous in order to call the (command) function. Instead of calling (command), I would (setvar "CLAYER" txt), then it should work either synchronous or asynchronous.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: set layer current function
« Reply #2 on: August 10, 2012, 06:55:04 AM »
Thanks owenwengerd, it works fine...

I did Barry Ralphs Tutorial http://opendcl.com/wordpress/?page_id=10.
Itīs a lot of things some you can do, but Iīm not sure what it realy do all form entities in OpenDCL editor. Kan you explain what it means "event invoke" a-synchromous. I didnīt find it in help.

This easy program should do set picked layer current and view the content in "block view 1" window. Can I do this with my method ?

Regards Dirk

owenwengerd

  • Bull Frog
  • Posts: 451
Re: set layer current function
« Reply #3 on: August 10, 2012, 02:36:30 PM »
Here is the help file description:
EventInvoke

I'm not sure about your other question because I don't understand which block you want to display when you select a layer, however it sounds like you should do that in your OnSelChanged event handler.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: set layer current function
« Reply #4 on: August 13, 2012, 08:20:45 AM »
Thanks Owen

Now I have two listbox in my form and would like ask which selection I have, I did it something like this:
Listbox name1: ListBoxLayer
Listbox name2: ListBoxLayerStandard

Code: [Select]
(defun c:LayerTool_PalLayer_ListBoxLayer_OnSelChanged (sL txtL /)
  (setq iL (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListboxLayer))
  (setq sL (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayer iL))
  )

(defun c:LayerTool_PalLayer_ListBoxLayerStandard_OnSelChanged (sS txtS /)
  (setq iS  (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListBoxLayerStandard))
  (setq sS (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayer iS))
  )
In final I would like move alle objects from selection layer ListBoxLayer to selection layer ListBoxLayerStandard
can I do it with two listbox in one form ?
« Last Edit: August 14, 2012, 04:46:53 AM by cadplayer »

owenwengerd

  • Bull Frog
  • Posts: 451
Re: set layer current function
« Reply #5 on: August 20, 2012, 02:02:20 PM »
It looks like you are ignoring the arguments to your event handlers for some reason.