- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hopefully someone will be able to see where I'm going wrong here.
I'm trying to modify the pnlcomp.lsp to add data to the USER3 field during report generation. I've been successful replacing the empty data with the word "TAGTYPE" but I can't get it to return to the report dialog.
My code appears to be working until I try to send the data back using the C:WD_RTRN_2WD function. Every time I enable the line that should do the work, my report dialog reports "processing . . ." and never returns to my control.
Here is the section of code I'm working with from the pnlcomp.lsp...
(progn ; user didn't cancel out of dialog, okay to continue
(if (= user_1 "1")
(progn
(setq TMPCOUNT 0 TEMPDATA1 nil TEMPDATA2 nil TEMPDATA3 nil)
(setq TEMPDATA1 wd_rdata)
(repeat (length wd_rdata)
; each item is a list in the list of lists named wd_rdata
; 6th item in the first list is the catalog number of the first component in the overall report.
; 32nd item in the first list is the SBT number of the first component in the overall report.
(setq LST (nth TMPCOUNT TEMPDATA1))
(setq TEMPDATA2 (wd_nth_subst 34 "TAGTYPE" LST)) ; replace USER3 field with "TAGTYPE"
(setq LST TEMPDATA2)
(setq TEMPDATA3 (subst LST (nth TMPCOUNT TEMPDATA1) TEMPDATA1))
(setq TEMPDATA1 TEMPDATA3)
(setq TMPCOUNT (1+ TMPCOUNT))
);end repeat
(setq OUTFL1 (open "G:\\jobs\\2018\\21807\\21807A Equipment\\ELEC\\TAGS\\TEST1.txt" "w"))
(princ wd_rdata OUTFL1)(PRINC "\n" OUTFL1)(close OUTFL1)(setq OUTFL1 nil)
(setq OUTFL2 (open "G:\\jobs\\2018\\21807\\21807A Equipment\\ELEC\\TAGS\\TEST2.txt" "w"))
(princ TEMPDATA1 OUTFL2)(PRINC "\n" OUTFL2)(close OUTFL2)(setq OUTFL2 nil)
(setq rtrn TEMPDATA1)
; (princ
; (strcat "\n " (c:wd_msg "WLAY031" (list "1" "pnlcomp.lsp") "Nothing defined for user%1 option (see %2)"))
) ) 😉
(if (= user_2 "1")
(progn
(princ
(strcat "\n " (c:wd_msg "WLAY031" (list "2" "pnlcomp.lsp") "Nothing defined for user%1 option (see %2)"))
) ) )
(if (= user_3 "1")
(progn
(princ
(strcat "\n " (c:wd_msg "WLAY031" (list "3" "pnlcomp.lsp") "Nothing defined for user%1 option (see %2)"))
) ) )
)
)
(c:wd_rtrn_2wd rtrn) ; return post-processed list back to AutoCAD Electrical's report dialog
I'm stumped... beginning to think the error is in the dialog itself, because the test files I'm outputting (TEST1.txt and TEST2.txt) appear to show everything works... until I try to apply the updated data to the "rtrn" variable.
Solved! Go to Solution.