Macro to split a string?


ACADuser
 Share

Recommended Posts

The 6th 7th & 8th characters from that WALL TYPE. Currently I'm using 3E as a wall type example. I may need 3E1 in the future.

 

%wall_type% returns "Wall 3E to roof", all my wall type names in this project start with "Wall xx ......."

I want the label on the wall to display in plan view as "3E"

 

Link to comment
Share on other sites

I'm sorry for any confusion, but it seems like your question is unclear or may be missing some context. Could you please provide more details or clarify your question so I can assist you better? Additionally, if you're referring to specific codes, terms, or descriptions, providing more context would help me provide a more accurate response.

Link to comment
Share on other sites

2 hours ago, isaiasquality said:

I'm sorry for any confusion, but it seems like your question is unclear or may be missing some context. Could you please provide more details or clarify your question so I can assist you better? Additionally, if you're referring to specific codes, terms, or descriptions, providing more context would help me provide a more accurate response.

chatgpt?

Link to comment
Share on other sites

On 12/14/2023 at 4:37 PM, ACADuser said:

%wall_type% returns "Wall 3E to roof",

Try using %wall_type.split(" ")[1]%

If your wall type is always formatted as shown, using split(" ") will create an array with each word separated by the space. Then the "[1]" selects the item from the array which starts at 0. If the formatting stays the same, this will extract the second part regardless of length.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share