M
Mark Dubbelaar
hi
i was wondering if you can have a while function return a string value
inside a command function... what i am trying to do is insert a viewport
title block, which could have 1,2,3 or 4 lines (depending on what the user
wants).... i am trying to use a while loop, to save on some duplication of
code, but it doesn't seem to work (i think the following code will describe
what i am trying to do)... the sTitleLines is a list of the title lines, the
sTitleScale is a string, the dTitleInsertPoint is a 3d point....
;code
(defun InsertTitle
(sTitleLines sTitleScale dTitleInsertionPoint / iTitleCount)
(setq iTitleCount 1)
(if (not (tblsearch "layer" "D-BLCK"))
(command "-layer" "m" "D-BLCK" "c" "white" "" "")
(command "-layer" "s" "D-BLCK" "")
) ;if
(command "-insert"
(strcat "Common Blocks/ViewportTitle"
(rtos (vl-list-length sTitleLines) 2 0)
)
dTitleInsertionPoint
"1"
"1"
"0"
(while (<= iTitleCount (vl-list-length sTitleLines))
(nth iTitleCount sTitleLines))
(setq iTitleCount (1+ iTitleCount))
)
sTitleScale
""
)
(princ)
)
any help would be great
cheers
mark
i was wondering if you can have a while function return a string value
inside a command function... what i am trying to do is insert a viewport
title block, which could have 1,2,3 or 4 lines (depending on what the user
wants).... i am trying to use a while loop, to save on some duplication of
code, but it doesn't seem to work (i think the following code will describe
what i am trying to do)... the sTitleLines is a list of the title lines, the
sTitleScale is a string, the dTitleInsertPoint is a 3d point....
;code
(defun InsertTitle
(sTitleLines sTitleScale dTitleInsertionPoint / iTitleCount)
(setq iTitleCount 1)
(if (not (tblsearch "layer" "D-BLCK"))
(command "-layer" "m" "D-BLCK" "c" "white" "" "")
(command "-layer" "s" "D-BLCK" "")
) ;if
(command "-insert"
(strcat "Common Blocks/ViewportTitle"
(rtos (vl-list-length sTitleLines) 2 0)
)
dTitleInsertionPoint
"1"
"1"
"0"
(while (<= iTitleCount (vl-list-length sTitleLines))
(nth iTitleCount sTitleLines))
(setq iTitleCount (1+ iTitleCount))
)
sTitleScale
""
)
(princ)
)
any help would be great
cheers
mark