Quantcast
Channel: Autodesk AutoCAD forums
Viewing all articles
Browse latest Browse all 14319

String Extraction / Modify commands using VB Help

$
0
0

I have some experience with Lisp but new to VBA for Acad. Can someone point me in the right direction to the String sub function?? or help me with this??

 

 

------------------------------------------------------------------------------------------------------------------------------------

I want to extract 3 different variable strings based on one large string such as:

 

"2013_ARCH-Lev01.dwg"       <or "2014_STRC-Lev00-BM">

 

and the 3 variables are:

 

Dim YEAR As String

Dim TRADE As String

Dim LEVEL As String

 

YEAR = 2013                           <or 2014>

TRADE = ARCH                        <or STRC>

LEVEL = 01                              <or 00-BM>

 

-----------------------------------------------------------------------------------------------------------------------------------

 

What are the best ways to do this / how do you do this?

 

I was thinking of using the first four digits "(0,1,2,3)" for YEAR??

using the next four digits following the underscore "_(0,1,2,3)" for TRADE??

and using the rest of the digits following the dash "-(unknown)" for LEVEL??

 

Like i said I'm new to this and am looking for guidence on how to do this and better ways to do this.. thanks

 

 


Viewing all articles
Browse latest Browse all 14319

Trending Articles