Jump to content

Fuge

Member
  • Posts

    158
  • Joined

  • Last visited

Reputation

11 Good

5 Followers

Personal Information

  • Occupation
    Design Director
  • Homepage
    Orbus.com
  • Hobbies
    Design, Music
  • Location
    United States

Recent Profile Visitors

1,378 profile views
  1. See this this function... https://developer.vectorworks.net/index.php?title=VS:Round HTH
  2. Thanks for the direction Pat... Did a quick test... this does what I was looking for... The design layer is always the same in our template.. So this works.... Posted for others... ----------------------- PROCEDURE VPView; VAR offsetX,offsetY,offsetZ :REAL; rotationXAng,rotationYAng,rotationZAng: REAL; result: BOOLEAN; objectHandle,LayerHandle :HANDLE; BEGIN objectHandle:= LSActLayer; { Selected Viewport } result:= GetViewMatrix( objectHandle, offsetX,offsetY,offsetZ, rotationXAng, rotationYAng, rotationZAng ); { Get the viewport matrix } Layer('Design Layer-1'); { Go to the Layer design layer with the 3d model } SetView( rotationXAng, rotationYAng, rotationZAng, offsetX,offsetY,offsetZ); { Set the view with the ViewMatrix variables from the viewport } VSave('The View'); { Save the view } END; Run(VPView);
  3. Hey Fellas... Has anyone figured out how to get the camera view of a viewport and save it as a saved view with a script? Steps to script.. I was thinking we're. 1. ActLayerName:=GetLName(ActLayer); { Set the active layer name as a string } 2. Edit Camera of selected Viewport.. - This is where I don't see a solution. Get the View of the Camera View - GetVPGroup() Nothing for Camera... or any other hook.. Need some way to navigate to the Design Layer with the view of the viewport. Some way to Edit Camera > Save The View > Return To Viewport... 3. Save View VSave('Test VP View'); 4. Return to the Layer(ActLayerName); Any insight is appreciated... There's always something you're not aware of.. 😆 Thanks! Dave
  4. Hey KingChaos, See the attached... The attached is saved back to VW22... But not tested there... HTH .. A lot more development is being worked on for this... Something I'll post in the future.. Procedure Taggit; VAR viewportHandle,VPGroupH, VPObject:HANDLE; VPName:STRING; ObjName:STRING; PROCEDURE TagObj(H:HANDLE); CONST TagName = 'Code Tag'; LeaderAbove = 250mm; LeaderRight = 100mm; KVerticalOffset = 100mm; VAR DataTagH,ObjectH,VPObject :HANDLE; StyleBoo, TagBoo,AnnoBoo :Boolean; TagX, TagY,x1,y1,x2,y2, pX, pY:REAL; ObjectTop, ObjectTopInSpace, ObjectCenter, ObjectCenterInSpace, LeaderX, LeaderY :REAL; BEGIN GetBBox(H,x1,y1,x2,y2); ObjectTop:=y2; ObjectTopInSpace:= (y1); ObjectCenter:= (x2-x1)/2; ObjectCenterInSpace:= ((x2-x1) + x1) - ((x2-x1)/2); DataTagH := CreateCustomObjectN('Data Tag', 0 ,0 ,0, False); StyleBoo := SetPluginStyle(DataTagH,TagName); TagBoo := DT_AssociateWithObj(DataTagH,H); AnnoBoo:= AddVPAnnotationObject( viewportHandle, DataTagH); DataTagH:= Lnewobj; LeaderY:= ObjectTopInSpace+LeaderAbove; LeaderX:= ObjectCenterInSpace+LeaderRight; HMove(DataTagH, LeaderX, LeaderY ); {Leader above center of object } SetRField(DataTagH,'Data Tag','__RefOffsetX',Num2StrF(Round(ObjectCenter))); { Move horizontal } SetRField(DataTagH,'Data Tag','__RefOffsetY',Num2StrF((ObjectTopInSpace-KVerticalOffset))); { Moves vertical } SetRField(DataTagH,'Data Tag','Horizontal Position','Right'); { Default side the leader is placed } SetRField(DataTagH,'Data Tag','World-based','False'); ResetObject(DataTagH); END; BEGIN Layer('View-1'); { Example Go to the layer you want by its name } ViewportHandle := GetObject('MyViewPort'); { Example - Get the Viewport you want be name, giving you a handle to it } If ViewportHandle=NIL THEN BEGIN AlrtDialog('Select a viewport!'); Sysbeep; END ELSE BEGIN VPGroupH:= GetVPGroup( viewportHandle,2); VPObject := FInGroup(VPGroupH); { The record criteria, class, etc to tag } ForEachObject(TagObj,((R IN ['Nimlok DB']) &(C='STEP-1') & (T<>LIGHT))); VPObject := NextObj(VPObject); UpdateVP( ViewportHandle); Redrawall; END; END; Run(Taggit); AutoDataTag_v2022.vwx
  5. Just a hunch... but are you using an older workspace from a previous version? That could be the problem possibly..
  6. Try something like this... I do this stuff all the time... Hopefully that helps. SetPenColorByClass (Lnewobj ); SetClass ( Lnewobj , 'YourclassName' ); SetTextureRefN( Lnewobj, -1, 3, 0);
  7. Okay... I should of realized that Data Tag is a pio. Knowing that here is the concept and example. Hopefully useful to others... I plan to tweak this further, but it shows it can be done. See the attached file as well, the procedure is on a script palette with a VP to look at.. Thanks Dave Procedure Taggit; VAR viewportHandle,VPGroupH, VPObject:HANDLE; VPName:STRING; ObjName:STRING; PROCEDURE TagObj(H:HANDLE); CONST TagName = 'Code Tag'; LeaderAbove = 250mm; LeaderRight = 100mm; KVerticalOffset = 100mm; VAR DataTagH,ObjectH,VPObject :HANDLE; StyleBoo, TagBoo,AnnoBoo :Boolean; TagX, TagY,x1,y1,x2,y2, pX, pY:REAL; ObjectTop, ObjectTopInSpace, ObjectCenter, ObjectCenterInSpace, LeaderX, LeaderY :REAL; BEGIN GetBBox(H,x1,y1,x2,y2); ObjectTop:=y2; ObjectTopInSpace:= (y1); ObjectCenter:= (x2-x1)/2; ObjectCenterInSpace:= ((x2-x1) + x1) - ((x2-x1)/2); DataTagH := CreateCustomObjectN('Data Tag', 0 ,0 ,0, False); StyleBoo := SetPluginStyle(DataTagH,TagName); TagBoo := DT_AssociateWithObj(DataTagH,H); AnnoBoo:= AddVPAnnotationObject( viewportHandle, DataTagH); DataTagH:= Lnewobj; LeaderY:= ObjectTopInSpace+LeaderAbove; LeaderX:= ObjectCenterInSpace+LeaderRight; HMove(DataTagH, LeaderX, LeaderY ); {Leader above center of object } SetRField(DataTagH,'Data Tag','__RefOffsetX',Num2StrF(Round(ObjectCenter))); { Move horizontal } SetRField(DataTagH,'Data Tag','__RefOffsetY',Num2StrF((ObjectTopInSpace-KVerticalOffset))); { Moves vertical } SetRField(DataTagH,'Data Tag','Horizontal Position','Right'); { Default side the leader is placed } SetRField(DataTagH,'Data Tag','World-based','False'); ResetObject(DataTagH); END; BEGIN ViewportHandle := LSActLayer; If ViewportHandle=NIL THEN BEGIN AlrtDialog('Select a viewport!'); Sysbeep; END ELSE BEGIN VPGroupH:= GetVPGroup( viewportHandle,2); VPObject := FInGroup(VPGroupH); { The record criteria, class, etc to tag } ForEachObject(TagObj,((R IN ['Nimlok DB']) &(C='STEP-1') & (T<>LIGHT))); VPObject := NextObj(VPObject); UpdateVP( ViewportHandle); Redrawall; END; END; Run(Taggit); AutoDataTag.vwx
  8. Hey Guys... Here I am again looking for something that's probably not doable.. But I'm throwing it out there... either I'm not seeing a way to do it, or can't find the functions to data tag an object. What I'm thinking.... 1. Select a viewport. 2. Run the script..... 3. All objects within the selected viewport, assigned to a particular class, are automatically data tagged... *** when you have a bunch of viewports and everything in each needs a tag this would be a monster time saver *** Any insight.. ideas... is appreciated... Thanks Dave
  9. That seems very odd... I think you'll need to do a re-installed...
  10. Hi Trevor, Why don't you just use =COUNT in a database row cell?
  11. Hello- Yeah like most files, plugins are not backward compatible. As you're seeing, VW 2021 won't recognize the edited plugin file from 2023. The best you can do is keep the plugin file native to each version and create your scripts in an include file and use calls that work in the older version, but you'll still have to keep both plugin files up to date. Or only create your plugins in the older version, but use them in both versions of VWs. HTH
  12. Hi Juan @JuanP There was a person looking for the examples again today... and the download links are still broken... I've reported this twice... in the last few months and they're still not fixed...
  13. There's some examples of PIOs on this page... http://web.archive.org/web/20210413010835/https://www.vectorworks.net/support/custom/vscript/example Same as what's on the developer site, but those links are still broken...
  14. If I follow you correctly... you should be able to do what you want. From the menu command you'll need to tell the PIO what to do... something like... { Your Plugin Object for Title Block } MyTitleBlockHhandle := CreateCustomObject('Your title Block Plugin Object',0,0,0); SetRField(MyTitleBlockHhandle,'Show date', TheDate,'x/xx/xxxx'); SetRField(MyTitleBlockHhandle,'Start date', ThestartDate,'x/xx/xxxx'); HMove(MyTitleBlockHhandle, xOffset, yOffset ); HRotate(MyTitleBlockHhandle, centerX,centerY,rotationAngle );
  15. Looking for freelance designer with some experience in the exhibit industry to do some assemblies from a provided Vectorworks library using our components. Must be proficient on Vectorworks, be using Vectorworks 2023 Design Suite, and have a dropbox account. Please send me a private message with your experience and hourly rate etc... Thanks Dave
×
×
  • Create New...