Is it possible to truncate a string up to a certain character?
With the code below, a block in inserted which joins the file name "UniversalBeams_610UB125" and the date "20200315.185925", to give the block name "UniversalBeams_610UB125-20200315.185925"
Is if possible to truncate up to and including the underscore character "_".
The final name would be "610UB125-20200315.185925".
(defun blkins (blkname) ; the name of the program or function must be defined in the first statement
(command "_.-insert" (strcat blkname "-" (rtos (getvar "cdate") 2 6) "=" blkname) pause 1 "" 0)
)
; "strcat": Returns a string that is the concatenation of multiple strings
; "rtos" Converts a number into a string
; "1" is the scale, "0" is the rotation