I have issues with it recognizing the selected views more times than note (triggering error handling).ģ. There appears to be an issue with the selection manager. One some systems, having certain unused libraries loaded will cause the macro not to function.Ģ.
RE: Help with VB Macro code Tobin1 (Petroleum) You don't have to make the macro figure out the document setting for section view text size. Unless you do lots of different drawings in which the Section View text size is different all the time, you can just use the tag, where X is whatever size fits your company standard for section view text size. In this case it works the same as Chr(13) or vbCrLf - makes a string display as multiple lines on screen.
The Chr() function returns the character corresponding to the function argument in ASCII. The macro will error out if you do not have a note selected prior to running.
That text contains the "tags" that instruct SW on how to actually display the note. You will see a message box that will match (as much as possible) the text as displayed on the screen along with the actual text that SW stores inside that note. Don't change the entire note using the Property Manager, use the popup text editing toolbar. To use this macro, create a note on a drawing. OutPut = OutPut & .GetSelectedObject6(1, -1).PropertyLinkedText OutPut = OutPut & vbCrLf & vbCrLf & "Actual text:" & vbCrLf OutPut = OutPut & .GetSelectedObject6(1, -1).GetText You would modify each of the InsertNote commands in the Definer subroutine similar to: Let's just say you want the first and second lines to be 10 and the last line to be 5. However, actually reading in those values is probably a bit beyond where you are right now in your VBA/SW API experience. It would be possible for the macro to read the document settings to determine the Section View Text and Note settings. The simplest way to change the font size would be to just hard-code in the size values inside the size tags. Since it is a note, it defaults to using the document note size setting. You will need to add the size tags into the text of the note being created. In this macro, the note is actually created and added to the drawing in the Definer() subroutine using the command "InsertNote." The note text is the argument of that function. This is going to be basically what you want to do programmatically. When you type that closing bracket ">", that text and brackets will disappear and all the following note text will change to size 40. For example, edit any note, put the cursor somewhere in the middle of the note, and type: However, you can do the same by manually typing in these text tags to the body of a note, and the "Use Document Font" setting will be unaffected. Doing this clears the checkbox for "Use Document Font" in the note's Property Manager. This adds invisible text tags to the contents of the note that affect how the text is displayed. A rich-text note is what you end up with if you manually create a note, then select a certain portion of the text of the note and change the font or font size in the pop-up text editing toolbar. That will require the note to be a rich-text containing note. It sounds like you are wanting to create a single note with different font sizes in it. RE: Help with VB Macro code handleman (Automotive) 29 Jan 08 10:01 I can look thru the code and figure out some of what is going on but not enough to figure out how to add the above function. The Macro is currently set up to use this text size for all text.Īs I said I’m a beginner at this.
I’d like to change the AddViewLabel's code so it will do the following:ġ) Use the SW “Section View Text” text size setting for the first two lines the Macro creates (Firster and Seconder).Ĭurrently the Macro uses the SW “Note” text size setting for all text size:Ģ) Use the SW “Note” text size setting for the third line the Macro creates (showme). I need the last line (the scale) to be a smaller text size than the other lines. I need to change the view label’s because, as I’m sure you are all aware, SW uses only one text size for both lines of the view label it produces. He’s agreeable with trying to add something to the code. Lorono to discuss an addition to the code. AddViewLabel is a collaborative effort by Matthew Lorono and Regg. I’ve found a Macro (AddViewLabel) that is very close to something that would help me label views the way I need to more efficiently. I downloaded a few nice SW Macro’s and recorded a couple of my own. I’ve been using SW daily for a little over a year now. In the past I used AutoLISP in AutoCAD for productivity enhancements. I’m just beginning to learn a bit about the SW API.