Jump to content

The Hamma

Member
  • Posts

    251
  • Joined

  • Last visited

Everything posted by The Hamma

  1. My current Record and Scripts. 1 Existing Object.vsm2 Demo Object.vsm3 New Object_Class.vsm4 NIC Object.vsm5 Remove Phase Record.vsm6 New Object.vsm7 Add Phase Record.vsm8-Phase 1.vsm9-Phase 2.vsmRelocate Existing.vsm Status Phase.vwx
  2. I figured it out. vs.SetPref(1505,True)#enable "Enable legacy 2D features" vs.SetPref(94,True)#enable "Unified View" vs.SetPref(1505,False)#diable "Disable legacy 2D features" Unified View On_2D Leg off.vsm
  3. Does anyone know the document preference index number for unified view. Some of my old drawings keep turning off unified view even after "Enable legacy 2D features" is disabled.. I would love to write a script to change the preference since the unified view button is unavailable when "Enable legacy 2D features" is disabled.
  4. I have been able to recreate this issue with files that contain references. Either the plan is referenced or the styles are referenced. Also causes havoc with the undo command.
  5. I would like Compound Hatches. For example I would like to create a PBU metal panel hatch for a roof or a wall but when I display that hatch at a small scale I would like it to read less dense. So if we could have compound hatches that is one hatch style that contains two different hatches and displays each based on the scale of the viewport. Below is how I would like a PBU hatch to display at different scales. Since most hatches are multi Leveled, maybe Level 1 displays at 1:20 scale and all the hatch Levels display at 1/4" scale.
  6. I love that the forum automatically added “2 years later..”!
  7. Probably not the issue but check your serial number to see what products are activated. Renderworks should be listed.
  8. I have had many issues with the undo command as well and I think it may have been related to MSI Afterburner and RivaTuner. I have uninstalled them and my undo issues appear to have gone away.
  9. I uninstalled MSI afterburner and RivaTuner and my undo issues have gone away for the time being.
  10. In every version of VW 2022 has the following wall component wrapping issue when inserting Doors or Windows in wall that have component wrapping enabled. If you use the Window or Door tool the components won't wrap but if you invoke the command by double clicking the style in the resource browser it will wrap the components. SP-1.1 has the following bug as well. WALL AND WINDOW BUG.vwx
  11. Perfect, Thanks. Here is a script to import two Text Styles into the current drawing that are stored in: {Workgroup folder or user folder}\Libraries\Defaults\Text Styles\Text Styles.vwx' """ Script to import two text styles into current drawing. Custom scripts can be added to: {Workgroup folder or user folder}\Libraries\Defaults\Text Styles\Text Styles.vwx Modify Style1 or Style2 to import your custom style This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 10/21/2021 """ Style1 = 'Callouts 10 pt' #change this to import different text style Style2 = 'Dimensions 10 pt' #change this to import different text style StyleFolder = 'Text Styles' #Name of resource folder to create in current drawing SourceSub = 'Defaults:Text Styles' #Sub path ResType =109 #Text Style type folderIndex =13 #Libraries if vs.GetName(Style1) != []: ResourceList, NumItems = vs.BuildResourceList(ResType, folderIndex, SourceSub) while NumItems != 0: ResourceName = vs.GetNameFromResourceList(ResourceList, NumItems) if ResourceName == Style1: vs.ImportResourceToCurrentFile(ResourceList,NumItems) if vs.GetObject(StyleFolder) == []: vs.NameObject(StyleFolder) vs.BeginFolderN(ResType) vs.EndFolder() vs.SetParent(vs.GetObject(Style1),vs.GetObject(StyleFolder)) NumItems -= 1 if vs.GetName(Style2) != []: ResourceList, NumItems = vs.BuildResourceList(ResType, folderIndex, SourceSub) while NumItems != 0: ResourceName = vs.GetNameFromResourceList(ResourceList, NumItems) if ResourceName == Style2: vs.ImportResourceToCurrentFile(ResourceList,NumItems) if vs.GetObject(StyleFolder) == []: vs.NameObject(StyleFolder) vs.BeginFolderN(ResType) vs.EndFolder() vs.SetParent(vs.GetObject(Style2),vs.GetObject(StyleFolder)) NumItems -= 1
  12. Ok, Follow up question. Does anyone know how to set the Document Text Style preference for future text objects to be a particular text style via script? and How to move text styles into a Text Style folder via script?
  13. I have looked through the SDK and maybe I am missing it but I can't find the Object Type ID integer for "Text Styles". Anyone know what it is?
  14. I have a script that worked great in 2021 but now in 2022 the drawing labels that are updated by the script do not update in the drawing. Any ideas how to get it to refresh. I have tried the obvious refresh, redraw options. """ Imports 'Drawing Label VA - Dwg No. Sht No.' into drawing and replaces other styles with this style 2022 Doesn't refresh plugin. Edit plugin geometry to refresh drawing after running script. David Hamer, 2020 Revised 2021-10-19 """ if vs.GetName('Drawing Label VA - Dwg No. Sht No.') != []: ResourceList, NumItems = vs.BuildResourceList(16, 13, 'Object Styles:Drawing Label') while NumItems != 0: ResourceName = vs.GetNameFromResourceList(ResourceList, NumItems) if ResourceName == 'Drawing Label VA - Dwg No. Sht No.': vs.ImportResourceToCurrentFile(ResourceList,NumItems) if vs.GetObject('Drawing Label Styles') == []: vs.NameObject('Drawing Label Styles') vs.BeginFolder() vs.EndFolder() vs.InsertSymbolInFolder(vs.GetObject('Drawing Label Styles'), vs.GetObject('Drawing Label VA - Dwg No. Sht No.')) NumItems -= 1 def dlupdate(h): if vs.GetPluginStyle(h) != 'Drawing Label VA - Dwg No. Sht No. NTS': if vs.GetPluginStyle(h) != 'Drawing Label VA - Dwg No. Sht No.': #pt= vs.Get2DPt(h,0) #vs.DelObject(h) #vs.Symbol('Drawing Label VA - Dwg No. Sht No.',pt,0) vs.SetPluginStyle(h,'Drawing Label VA - Dwg No. Sht No.') #vs.SetClass(h,'A-ANNO-LABL') vs.ResetObject(h) #vs.ReDrawAll vs.ForEachObject(dlupdate, "(INSYMBOL & INVIEWPORT & (PON='Drawing Label2') & (V))") vs.DSelectAll; test.vwx Drawing Label format.vsm
  15. I was having Undo problems in 2021 also. Now I’m continuing to have those same problems in 2022. Most of the time it has to do with relocating walls or symbols within the walls that cause the undo to break.
  16. Ok next issue. I can make two options work with the YES@CONDITION:NO . But when I try to divide space number field with a number that I placed in the user field it only displays it displays it as text. Input #Space#.#Area##doc area_3_0#/#Space#.#11_User-Def Info 2# or #Space#.#Area##doc area_3_0#/#Space#.#11_User-Def Info 2##VAL# or #Space#.#Area##doc area_3_0#/#Space#.#11_User-Def Info 2##INT# Output 100/15 instead of 6.66 How do I force the tag to read #Space#.#11_User-Def Info 2# as a number rather than text?
  17. OK I got the @ outcomes to work but it only works with two options. I was hoping the “if” function would work so I could evaluate three options.
  18. I cannot get an IF expression to work in the Data Tag. What am I doing wrong? I am working with a Data Tag linked to a Space and and I tried the example directly from the help guide and it does not work. It only prints the formula in the tag. From the help guide
  19. Updated 2022-03-08 ... Added companion script to move selected symbols to a new symbol folder to use as a filter for the Symbol Legend Script. Updated 2021-10-08.... re-download script if you download it prior. Thanks to @michaelk for figuring out how to make Data tags appear in my schedule and for helping me with the textstyle. Here is my go at the plugin version of a symbol legend. Unlike @michaelk my script does not provide headers for the columns so if you need that try his version. This legend was created using "Tags" as a description, "Test Folder" as the source resource folder and since the symbols are inserted alphabetically I added a number in front of the name of each symbol in the drawing to determine the order that they were inserted in. If the filter fields are populated tool will use the filter. If the checkboxes are checked the tool will exclude items filtered. If text style "SymLegendTS" doesn't exist it will be created. Modify this style to change the text style of the labels. PIO can be exploded and manually adjusted. each symbol and description are in individual groups. I you try it out and find any issues please let me know. Symbol Legend.vso Move Symbol to Folder.vsm
  20. I have the handle to a symbol and I would like to create a separate group of a copy of the 2D symbol objects that can be inserted into the drawing with a plugin object script but I cannot get it to work. h5 = handle to symbol This works. I had to double vs.FInSymDef vs.BeginGroup() vs.Locus(0,0) vs.EndGroup gr1 = vs.LNewObj() h7 = vs.FInSymDef(vs.FInSymDef(h5)) while h7 != []: vs.CreateDuplicateObjN(h7,gr1,True) h7 = vs.NextObj(h7)
  21. I simplified the script to the following. It appears to be something with it being a point object plugin tool and not when it is run as a simple script as it works as a script but not as a plugin object. To my knowledge it appears to only be an issue with tag objects. h1 =vs.FSymDef() while h1 != []: vs.Symbol(vs.GetSDName(h1),0,0,0) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: if vs.GetTypeN(h2) == 16: vs.Symbol(vs.GetSDName(h2),0,0,0) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1)
  22. I have written a script and created a "Symbol Legend (custom plugin)" tool. It works great except for one issue. When the symbol is a data tag the symbol the tag symbol does not appear. If I explode the plugin the symbol appears. This only happens when there is a description to type on the screen or if there is a second symbol in the resource browser. If there is no description the tag does appear. Tag is the only symbol in the drawing Tag and Watercloset symbol are in drawing. VSO attached. """ This script inserts all of the symbols in the current drawing resource manager into the drawing with the text in Record "Legend Record" and field "Legend Text" if assigned to a symbol. It ignores symbols with the record but no text in the "Legend Text" Field. First run will create "Legend Record" if it does not exist. This Python Script may be freely distributed. No warranty provided. Use at your own risk. David Hamer, 2021 revision 10/4/2021 """ xP = yP = p4y = p5y = 0 def name(h): global nameSY if vs.PDescription == 'Tag': if notag == False: tagarray = vs.GetResourceTags(h) nameSY = (tagarray[0]) else: nameSY = '' if vs.PDescription == 'Symbol Name': nameSY = (vs.GetSDName(h)) if vs.PDescription == 'Record': nameSY = vs.GetRField(h,'Legend Record','Legend Text') def EvaluateSym(h): if vs.PExclude == True: if vs.GetName(vs.GetParent(h1)) != vs.PSymbolFolder: appendtolist(h) else: appendtolist(h) def appendtolist(h): if vs.PRecordName == '': hSEL.append(h) else: if vs.PRecordExclude == True: if vs.Eval(h, "(R IN ['"+vs.PRecordName+"'])") != True: hSEL.append(h) else: if vs.PRecordExclude == False: if vs.Eval(h, "(R IN ['"+vs.PRecordName+"'])") == True: hSEL.append(h) def DoIt(h5): global xP,yP,p4y,p5y,p3x,p3y,p2x,p1y h6 = h5 (p1,p2) = vs.GetBBox(h5) p1x=p1[0] p1y=p1[1] p2x=p2[0] p2y=p2[1] p3x = p2x-p1x p3y = p1y-p2y p5y = p4y+p1y-((p3y/2)+p1y) vs.Symbol(vs.GetSDName(h),xP+((p3x/2)-p2x),p4y-p1y,0) vs.TextOrigin(xP+vs.PControlPoint01X,p5y) vs.TextSize(vs.PTextsize) vs.TextVerticalAlign(3) vs.TextFont('Arial') name(h5) vs.CreateText(nameSY.upper()) p4y -= p3y + vs.PSymbolSpacing if vs.GetObject('Legend Record') == (): # Creates "Status and Phase" record if not present vs.NewField('Legend Record', 'Legend Text', '', 4, 0) hSEL = [] if vs.PSymbolFolder != '': if vs.PExclude == False: h1 = vs.FInFolder(vs.GetObject(vs.PSymbolFolder)) else: h1 =vs.FSymDef() else: h1 =vs.FSymDef() while h1 != []: EvaluateSym(h1) if vs.GetTypeN(h1) == 92: h2 = vs.FInGroup(h1) while h2 != []: if vs.GetName(vs.GetParent(h2)) != vs.PSymbolFolder: EvaluateSym(h2) h2 = vs.NextObj(h2) h1 = vs.NextObj(h1) for h in hSEL: if vs.GetTypeN(h) == 16: if vs.PDescription == 'Tag': tagarray = vs.GetResourceTags(h) if tagarray: notag = False DoIt(h) else: notag = True DoIt(h) else: DoIt(h) Symbol Legend.vso
×
×
  • Create New...