0 Members and 1 Guest are viewing this topic.
(if (setq parentKey (Odcl_Tree_GetParent MyProject_MyForm_MyTree childKey)) (LetUsRollWithThe parentKey))
(defun SetUp ( / RootDir SubDir i1 i2 i3 i4 FosterParent ChildX FileList FileDir BlockList Path) (setq StartDir "s:\\caddstds\\details\\") (setq RootDir (dos_subdir StartDir)) (foreach i1 RootDir (setq FosterParent (Odcl_Tree_AddParent BlockTree_Form1_TreeControl1 i1)) (setq x (strcat StartDir i1)) (setq SubDir (dos_subdir (strcat StartDir i1))) (foreach i2 SubDir (setq ChildX (Odcl_Tree_AddChild BlockTree_Form1_TreeControl1 FosterParent i2)) (setq FileDir (strcat x "\\" i2 "\\*.dwg")) (setq FileList (dos_dir FileDir 1)) (foreach i3 FileList (setq Path (strcat x "\\" i2 "\\" i3)) (if (findfile path) (setq BlockList (LoadBlocks (findfile Path))) ) (if BlockList (foreach i4 BlockList (Odcl_Tree_AddChild BlockTree_Form1_TreeControl1 ChildX i4) ) ) ) ) ))