Jump to content

MullinRJ

Member
  • Content Count

    1,464
  • Joined

  • Last visited

Community Reputation

202 Spectacular

7 Followers

About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    United States

Recent Profile Visitors

2,123 profile views
  1. Hi Sam, What Pat said. If you still need to call, please feel free at any time. Raymond
  2. Hi @Taproot , You have a good eye, but there is not an easy way in VS to describe how to determine the font assigned to a text block. Rather than try to guide you through it, I made the changes to the previous script and posted it below. As you can see, it still took me about an hour to do this and I still took the easy way out by only checking the first character of a text block to check the font assignment. See next paragraph. I modified the previous script to only change the font type of Arial text blocks. You can specify the font to be changed by changing the constant "kFontNm" at the top of the program. There is one caveat, this script assumes that if a text block starts with a character in the Arial font, the whole text block is Arial. This script does not change individual characters within a text block. That can be done, but requires a bit more time to code. <<< THIS SCRIPT IS LIGHTLY TESTED — VERY LIGHTLY TESTED. USE AT YOUR OWN RISK, AND PLEASE TRY IT ON A TEST FILE FIRST. >>> Also, I corrected a mistake in the previous script that did not pass back the point size in variable "PointSize" from the FormatTextDialog() procedure. That is now corrected in the above script and in the one posted below. If anyone finds any problems with this script, please write back and I'll have @PatStanford get right on it. 😉 PROCEDURE ChangeSomeFonts; { Changes the font of all text on a drawing to the selected font } { Traverses into groups, symbols and viewport annotations } { January 6, 2012 } { © 2012, Coviana, Inc - Pat Stanford pat@coviana.com } { Licensed under the GNU Lesser General Public License } { 17 February 2020 - R. Mullin } { Added ability to set the Point Size of all text objects at the same time. } { Same GNU License as above. } { 7 October 2020 - R. Mullin } { Only change Text Blocks with name specified in constant "kFontNm" to target font name "kNewFontNm". } { Same GNU License as above. } CONST kFontNm = 'Arial'; { change from this font name } VAR Hd :Handle; NewFontNm :String; FontID, dummyInt :Integer; PointSize, dummyReal :Real; Procedure ChangeFont(Hd :Handle); Var FID :Integer; Begin if (GetTypeN(Hd) = 10) then begin FID := GetTextFont(Hd, 0); { assumes all characters in txtBlk are the same fontID } if (FontID = FID) then begin SetTextFont(Hd, 0, len(GetText(Hd)), GetFontID(NewFontNm)); SetTextSize(Hd, 0, len(GetText(Hd)), PointSize); end; { if (FontID = FID) } end; { if GetTypeN() } End; { ChangeFont } BEGIN FontID := GetFontID(kFontNm); { existing FontID } FormatTextDialog(NewFontNm, dummyInt, PointSize, dummyInt, dummyReal, dummyInt, dummyInt, 60); ForEachObject(ChangeFont, INSYMBOL & INOBJECT & INVIEWPORT & ALL); END; Run(ChangeSomeFonts); HTH, Raymond
  3. On further thought, have you looked at the CLIP commands? They might do what you are looking for. ClipPolygon() ClipSurface() ClipSurfaceN() HTH, Raymond
  4. Hi @josue Corona , There is not a single command that will do that. There are commands in the VS language that will return intersection points between objects: LineCircleIntersect() LineEllipseIntersect() LineLineIntersection() EllipseEllipseIntersect() And there are other commands that will determine if the points in question are on Line segments, or Arc segments: PtOnArc() PtOnLine() But to use these the way you are probably hoping for will require a fair amount of coding to take the points they return and manipulate your target object to break at the right spots. If you like Analytic Geometry you can get there from here. If not, you might consider hiring someone who does. Not sure if this helps, Raymond
  5. @WhoCanDo , I don't know what changed with the DMTBN() command. However, there are 32 new VS commands in VW 2021 that interface with Excel files. I have not used them so I cannot comment on them beyond their existence. Perhaps you can loop through your Worksheet's cells and export each cell to an Excel file. It seems more tedious than simply exporting to a text file, but it may give you more control. If you're lucky, @Pat Stanford has dabbled with these and can shed some light. These are the commands listed in the Script reference. Documentation is what you'd expect – thin. Excel_Convert EXL_AddSheet EXL_CloseBook EXL_DeleteSheet EXL_GetCellAlignment EXL_GetCellBordeDiff EXL_GetCellBorderB EXL_GetCellBorderL EXL_GetCellBorderR EXL_GetCellBorderT EXL_GetCellFill EXL_GetCellFont EXL_GetCellStyle EXL_GetCellValue EXL_GetSheetCnt EXL_GetSheetIndex EXL_GetSheetName EXL_GetSheetSize EXL_IsCellValid EXL_NewBook EXL_ReadFile EXL_SaveAndCloseBook EXL_SetCellAlignment EXL_SetCellBorderB EXL_SetCellBorderL EXL_SetCellBorderR EXL_SetCellBorderT EXL_SetCellFont EXL_SetCellNumber EXL_SetCellNumFormula EXL_SetCellStrFormula EXL_SetCellString Good luck, Raymond
  6. Gentlemen, Please check out this page in the VW Help. It's the only place I know that lists the WS Functions. https://app-help.vectorworks.net/2021/eng/index.htm#t=VW2021_Guide%2FWorksheets%2FWorksheet_functions.htm%23XREF_16089_Worksheet_Functions Raymond
  7. Hi @Sebastiaan , I'm seeing that. After too much trial and error, I've come to the same conclusion. Oddly, this works to show all 40 of the LDs'. =DATABASE((NOTINREFDLVP & NOTINDLVP & (PON='Lighting Device') & ('Lighting Device'.'Channel'>'0'))) BUT, this does not work as expected: =DATABASE((NOTINREFDLVP & NOTINDLVP & (PON='Lighting Device') & ('Lighting Device'.'Channel'>'1'))) It only shows LD's with channels 3-9, and 20. What I've noticed is that the DATABASE() engine is comparing strings, and not numerical values (as you'd like). Strings starting with "2xxx" through "9xxx" satisfy the equation, but strings "10" to "19" and "101" to "120" don't satisfy it because the first character in each string is a "1". You really need a VALUE() function, and that only appears to work in a worksheet cell, and not in a Database row. Sorry, I'm stumped. Raymond
  8. @Sebastiaan , Like Pat, I don't have a file to test this, but if a LD does not yet have a channel then this might work. =DATABASE( (NOTINREFDLVP & NOTINDLVP & (PON='Lighting Device') & ('Lighting Device'.'Channel'<>'') & (VALUE('Lighting Device'.'Channel')>=1) & (VALUE('Lighting Device'.'Channel')<=100)) ) This expression checks for an empty channel string before it tests the values in the channel HTH, Raymond
  9. Hi @matteoluigi , You can get the handle to any named object using GetObject() like this: H := GetObject('Wohnungstypen-Auto'); if (H <> nil) & (GetTypeN(H) = 18) then begin { type 18 = Worksheet } { do worksheet stuff here } end; { if } It is always wise to check a handle's validity and type before using it. HTH, Raymond
  10. @matteoluigi , There is a problem with your syntax of the 6 IF statements. Where you have " ))=1) " you should have " ))) =1 " Your last parenthesis should be to the left of the "=". The syntax is essentially " COUNT ( ... ) = aNumber ". Yes you can have statements lilke: if ( ) then begin end else if ( ) begin end else if ( ) begin end else begin end; Notice there is only 1 semicolon at the end, and not after each else if clause. HTH, Raymond
  11. I knew someone (@Pat Stanford) would have an elegant way to get inside. Thanks, Pat. Raymond
  12. Using: Message(GetTypeN(FSActLayer)); If I select a free standing Door I get type 86 (Plug-In object). If I select a a Door in a Wall I get type 68 (Wall object). To see the Door on a test wall I have in an open document, I needed to use: Message(GetTypeN(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(FIn3D(FSActLayer)))))))))); As you can see, the door object is deep inside the Wall object. The number of objects in front of it are not exact, and are determined by the wall's construction. You should use a loop to look for the Door, or possibly try ForEachObjectAtPoint(). There may be a more direct way to get to the Door-in-Wall that someone else can point to. I've just done a cursory quick dive at this. Again, make sure your handle is pointing to a Door object before trying to access its record. HTH, Raymond
  13. Are you sure you have a handle to the Door and not the Wall? Raymond
  14. @Paolo , I did a quick test and it looks like the function HasPlugin() only returns TRUE if you have the plug-in installed in your workspace. Loading a plug-in after you have a resource/object of the same name will cause a conflict, but I don't know how VW responds in that scenario. I can only assume it causes more confusion. Raymond

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...