×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Alphabetize configlist in SolidWorks

Alphabetize configlist in SolidWorks

Alphabetize configlist in SolidWorks

(OP)
Hey guys, this is spun off another thread that I started over in the SolidWorks forum, though I'm not sure this is the exact correct place to ask this question. I'm currently developing a macro within SolidWorks and have run into a slight irritant. It seems that SolidWorks orders configuration numbers based on when they were created, not what order they appear in within the program. Anyway, I'm retrieving the list of configurations within SolidWorks with the following little bit of code

CODE

ConfigList = swDoc.GetConfigurationNames()

This places a list of strings within ConfigList, each one being the name of a configuration. This is done so I can later reference these names and attach them to a page in a GUI. These names are retrieved based on the order they were created though. Is there a way to take this list and then alphabetize the string array so that they appear in alphabetical order? I want to alphabetize it so that the correct name shows up on the correct page number according to the order SolidWorks shows the configurations. Pardon me if this is a little confusing, I'm still rather new to this whole VBA and object oriented language thing.

RE: Alphabetize configlist in SolidWorks

If the version of VBA is newer, you can use the built in sort method.

CODE

ConfigList.Sort(ConfigList)

If the version of VBA does not support this method, you will have to write your own code to sort. A web search on the term "sort array VBA" will return thousands of webpages that can give detailed instructions and code.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources