OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: juniorolisp on January 08, 2018, 04:20:11 AM

Title: Tree - getchield
Post by: juniorolisp on January 08, 2018, 04:20:11 AM
Hello. I would like to create an a list for a tree

When you click on "2018-01-23"
(Start XXXX XXXX 2018)

When you click on "XXXX"
(Start XXXX XXXX)

e.t.c.
How to do it
Title: Re: Tree - getchield
Post by: Fred Tomke on January 08, 2018, 04:31:24 AM
Hello, I have to say that I didn't quite understand your desire. You can get notified when the current selection was changed using OnSelChanged (http://www.opendcl.com/HelpFiles/DEU/Reference/Event/SelChanged-Key.htm) event. Or you react on OnClicked (http://www.opendcl.com/HelpFiles/DEU/Reference/Event/Clicked.htm)-event. Use the GetNextSiblingItem or the GetPrevSiblingItem method to get sibling nodes or GetParentItem to retreive the parent node.
Regards, Fred
Title: Re: Tree - getchield
Post by: Fred Tomke on January 08, 2018, 04:33:06 AM
Hi, in addition to my first answer and in relation to your topic name use GetFirstChildItem method to get the first child node of an item. Regards, Fred
Title: Re: Tree - getchield
Post by: juniorolisp on January 08, 2018, 04:43:25 AM
Exactly the reverse of this function (GetFirstChildItem)
Title: Re: Tree - getchield
Post by: Fred Tomke on January 08, 2018, 04:57:27 AM
Hello, if you mean something like "GetLastChild" you have to iterate all nextsiblings of a level unless you're keeping a list of all nodes in a list or blackboard.
Regards, Fred
Title: Re: Tree - getchield
Post by: roy_043 on January 08, 2018, 05:19:55 AM
It think the OP wants a list representing a tree item's nesting level. Using the dcl-Tree-GetParentItem function it should be possible to create a custom function for this purpose.
Title: Re: Tree - getchield
Post by: juniorolisp on January 22, 2018, 02:10:10 AM
Thank you for quick reply. everything works