Jump to content

JoshRula

Member
  • Posts

    15
  • Joined

  • Last visited

Reputation

2 Neutral

Personal Information

  • Location
    United States
  1. ok, so using GetCustomObjectInfo I have been able to capture what I needed, InfoSuccesful:= GetCustomObjectInfo(ojectName, objectHand, recordHand, wallHand); H1:=objectHand; H2:=recordHand; H3:=wallHand; sRecordName:=GetName(H2); NumOfFields:=NumFields(H2); NumOfRec:=NumRecords(H1); F1:=GetFldName(H2, 3); F2:=GetFldType(H2, 3); F3:=GetRField(H1,sRecordName,f1); message(CONCAT(NumOfFields,'*',ojectName, '*',sRecordName,'*',f1,'*',F3)); I was passing the wrong handle to GetRField. thanks for your willingness to help, I am back onto figuring out how to use your "push" values example.
  2. Pat, Thanks so much I am having trouble interacting with the record, I made a simple object with some parameters so I can play with it, but cant seem to figure out the format. this code tells me that there are 6 records, I cant seem to get record or field names out to understand the structure where should I look for more explanation on the record format and how to interact with it? PROCEDURE pioudate; VAR rMargin, rLayerScale, rWidth, rHeight : real; p1, p2 :point; iNumInst : longint; H1, H2, H3 : handle; F1,F3,F4,F5,F6,F7,F8,F9,F10:STRING; F2, NumOfRec, NumOfFields : integer; (* procedure editParam(h:handle c:longint); Begin h:=GetObjet('interconected pio Copy'); c:=Count(N = 'interconected pio Copy'); SetRField(h,'PiNumInst', *) Begin rWidth:=PrWidth; rHeight:=PrHeight; rLayerScale:=GetLScale(ActLayer); iNumInst:=PiNumInst; rMargin:=PrMargin*rLayerScale; Rect(p1.x,p1.y,p2.x,p2.y); MoveTo(p2.x-(1.6*rLayerScale)-rMargin,p2.y+rMargin); Rect(rWidth*rLayerScale, #0, rHeight*rLayerScale, #90); iNumInst:=Count(N = 'interconected pio Copy'); H1:=LNewObj; H2:=GetRecord(H1,1); H3:=GetParametricRecord(H1); NumOfFields:=NumFields(H3); NumOfRec:=NumRecords(H3); F1:=GetFldName(H3, 1); F2:=GetFldType(H3, 1); F3:=GetRField(H3, 'Margin','Margin'); {F4:=GetFldName(H3, 4);} (* F5:=GetFldName(H2, 5); F6:=GetFldName(H2, 6); F7:=GetFldName(H2, 7); F8:=GetFldName(H2, 8); F9:=GetFldName(H2, 9); F10:=GetFldName(H2, 10); *) message(CONCAT(' * ',f1,' * ',NumOfFields,' * ',NumOfRec,' * ',F2,F3,F4,F5,F6,F7,F8,F10)); End; RUN(pioudate);
  3. I have been experimenting with ForEachObject and see how that will let me cycle through resetting all my pio's, What I am missing is getting one pio to read the state of a boolean in another pio, and how to get a parameter (i.e rMargin) that is entered in the 1st pio to end up in the 2nd pio on its reset. I really appreciate all the help guys.
  4. I have made a pio That has a few parameters I would like to have shared between all instances of the object in a single file across layers. Can someone point me to a code example of how to accomplish this? I found an article about naming the objects with uuid but cant seem to relocate it.
  5. Pat, thanks for the reply that worked out great, I made a command tool that had only the code needed to create the plugin object at the correct location.
  6. I have made it by choosing the "command" radio button after clicking "new" in the plug in manager, it uses the default values of the parameters and creates 22 independent objects in the correct location and rotation. I can select any of them and interact with them the same as if I had drawn them individually, not through the OIP. I have also made it by choosing the "tool" radio button after clicking "new" in the plug in manager, If you double click the tool on the palette you can edit all to parameters before the script gets executed, but then it draws 22 independent objects in the correct location and rotation. I can select any of them and interact with them the same as if I had drawn them individually, not through the OIP. I have also made it by choosing the "point object" radio button after clicking new in the plug in manager, If you double click the tool on the palette you can edit all to parameters before the script gets executed, when you click in the drawing area it shows a silhouette of the geometry that will be created and permits you to set a rotation. When yo select the object created you can edit the parameters from the object info palette. What "container" does a single point plug in object put my code in that permits it to be viewed by vw as a single object with parameters? Can I add this "Container" to the code I used for the plugin in object "command" or "tool"?
  7. Can you point me at some custom object sample code or tutorial?
  8. So, I have built a plugin that makes a Title block that will fit my companies work flow, I have created it as various plug in types but haven't gotten exactly the behavior I want. when I run the code as a command it doesn't create a high level object and permit me to edit it with the oip. If I make it as a single point object it does, but I want the position and rotation to be locked. when I run it as a tool rotation is locked, but position isn't and I cant access parameters in the OIP. Is there a Container I need to build the objects inside of to keep the OIP functionality? I have tried group and symbol to no avail. Procedure TitleBlock; const kUnit=1; VAR H1, H2, H3, H4 : handle; p1, p2 : point; width, height, rMargin, rLayerScale, rU : real; rPageHeight:real; sShipDate, sOrderNum, sDocName, sStartDate :string; sShowDates, sDrawnBy, sCompanyName, sSheetTitle, sLayerName:string; iDimg:handle; iCompanyNameLength, iTotalPages, iPageNum: integer; {**************************Main Code Block*********} BEGIN; {Set parameteers} sLayerName:=GetLName(ActLayer); sSheetTitle:=sLayerName; iCompanyNameLength:=PiCompanyNameLength; sDrawnBy:=PsDrawnBy; sShowDates:=PsShowDates; sStartDate:=PsStartDate; iPageNum:=PiPageNum; iTotalPages:=PiTotalPages; sShipDate:=PsShipDate; {******************} sDocName:=(GetFName); sOrderNum:=Copy(sDocName,1,6); sCompanyName:=Copy(sDocName,7,iCompanyNameLength); rLayerScale := GetLScale(ActLayer); rU:=kUnit*rLayerScale; GetDrawingSizeRectN(ActLayer,p1.x,p1.y,p2.x,p2.y); rPageHeight:=Distance(p2.x,p1.y,p2.x,p2.y); rMargin :=PrMargin*rLayerScale; {**********************Primary Rectangle container***********} {RectangleN(orgin, direction, width, height)} width:=1.72*rU; height:=rPageHeight-(rMargin*2); RectangleN(p2.x-width-rMargin,p2.y+rMargin, 1, 0, width, height); {*********************Page Num Rect***********************************} MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)); { set pen position } Rect(width-(.0625*2)*rU, #0, (.538*rU), #90); {***********text Label*********} Relative; MoveTo(.377*rU,(.43*rU)); TextSize(10); BeginText; concat('PAGE #:') EndText; Absolute; MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)); {***********page numbering*********} Relative; MoveTo(width/2-(.065*rU),(.165*rU)); TextSize(12); BeginText; concat(iPageNum,' OF ',iTotalPages) EndText; Absolute; {*****************ship date Rect**********************} MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)+(.538+.0625)*rU); { set pen position } Rect(width-(.0625*2)*rU, #0, (.538*rU), #90); {***********text Label*********} Relative; MoveTo((.5*rU),(.43*rU)); TextSize(10); BeginText; concat('SHIP DATE:') EndText; {***********SHIP DATE*********} MoveTo((.353*rU),(-.265*rU)); TextSize(12); BeginText; concat(sShipDate) EndText; Absolute; {*****************Order Number Rect**********************} MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)+((.538+.0625)*2)*rU); { set pen position } Rect(width-(.0625*2)*rU, #0, (.538*rU), #90); {***********text Label*********} Relative; MoveTo((.445*rU),(.43*rU)); TextSize(10); BeginText; concat('ORDER #:') EndText; {***********Order Number*********} MoveTo((.353*rU),(-.265*rU)); TextSize(12); BeginText; concat(sOrderNum) EndText; Absolute; {*****************Downing Logo Rect**********************} MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)+((.538+.0625)*3)*rU); { set pen position } Rect(width-(.0625*2)*rU, #0, (3.125*rU), #90); iDimg:=ImportImageFile('C:\Users\jstewart\Desktop\Vectorworks scripting\downingjpg.jpg',(p2.x-((.86*rU)+rMargin)),(p2.y+(3.308*rU)+rMargin)); {*****************Start show drwn boxes**********************} MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)+((.538+.0625)*3+3.1875)*rU); { set pen position } Rect(.49*rU, #0, (1.5*rU), #90); Relative; MoveTo((.49+.0625)*rU,0); Rect(.49*rU, #0, (1.5*rU), #90); MoveTo((.49+.0625)*rU,0); Rect(.49*rU, #0, (1.5*rU), #90); Absolute; MoveTo(p2.x-width-rMargin+(.0625*rU),p2.y+rMargin+(.0625*rU)+((.538+.0625)*3+3.1875)*rU); { set pen position } {***********start date text Label*********} Relative; MoveTo(.110833*rU,.75*rU); TextRotate(90); TextSize(8); BeginText; concat('START DATE') EndText; H1:=LNewObj; SetTextStyle(H1,0,11, 4); {***********Start Date*********} MoveTo(.24*rU,0); TextSize(12); BeginText; concat(sStartDate) EndText; {***********Show Dates text Label*********} Relative; MoveTo(.309861*rU,0); TextRotate(90); TextSize(8); BeginText; concat('SHOW DATES') EndText; H1:=LNewObj; SetTextStyle(H1,0,11, 4); {***********Show Dates*********} MoveTo(.24*rU,0); TextSize(12); BeginText; concat(sShowDates) EndText; {***********drawn by text Label*********} Relative; MoveTo(.309861*rU,0); TextRotate(90); TextSize(8); BeginText; concat('DRAWN BY') EndText; H1:=LNewObj; SetTextStyle(H1,0,11, 4); {***********Drawn By*********} MoveTo(.24*rU,0); TextSize(12); BeginText; concat(sDrawnBy) EndText; Absolute; {****************revision block **************} iDimg:=ImportImageFile('C:\Users\jstewart\Desktop\Vectorworks scripting\revisionbox.jpg',(p2.x-((.86*rU)+rMargin)),(p2.y+(16.196795*rU)+rMargin)); {*******************************Title Rect************************} MoveTo((p2.x-width-rMargin+(.0625*rU)),p2.y+rMargin+6.614705*rU); Rect(1.6074*rU, #0, 8.045186*rU, #90); {***********Company name and LayerName text Label*********} Relative; MoveTo(.602033*rU,4.022593*rU); TextRotate(90); TextSize(24); BeginText; concat(sCompanyName,' / ',sSheetTitle) EndText; H1:=LNewObj; SetTextStyle(H1,0,50, 5); {***************scale ************************} MoveTo(.445261*rU,-1.784770*rU); TextRotate(90); TextSize(18); BeginText; concat('SCALE 1:300') EndText; H1:=LNewObj; SetTextStyle(H1,0,50, 1); {message(concat(rPageheight,' ',width,' ',height,' ',rlayerscale,' ',rU));} END; Run(TitleBlock);
  9. I am attempting to make an object that fills a page regardless of page size, TBB_GetPageArea reports dimensions that are a bit larger then what is set on page set up. what am I missing? VAR {******Page Corners} PCTL, PCTR, PCBL, PCBR :point; {********Layer Scale} rLScale : real; {*******DrawingArea} outDrawingArea:string; outIsOther:boolean; outIsOnePrintedPage:boolean; sDrawingArea:string; TBTL,TBBR :point; rPageWidth, rPageHeight:real; rPageWPerc, rPageHPerc:real; BEGIN; {********************* Set Page Corner Locations ********************************} TBB_GetPageArea(ActLayer,rPageWidth,rPageHeight); rLScale := GetLScale(ActLayer); GetDrawingArea(outDrawingArea,outIsOther,outIsOnePrintedPage); PCTL.x:= (0-((rPageWidth/2)-.36)*rLScale); PCTL.y:= (((rPageHeight/2)-.36)*rLScale); PCTR.x:= (((rPageWidth/2)+.36)*rLScale); PCTR.y:= (((rPageHeight/2)-.36)*rLScale); PCBL.x:= ((0-(rPageWidth/2)+.36)*rLScale); PCBL.y:= ((0-(rPageHeight/2)+.36)*rLScale); PCBR.x:= ((rPageWidth/2)-.36)*rLScale; PCBR.y:= ((0-(rPageHeight/2)+.36)*rLScale); {**********************************************************************} (* rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); *) rPageWPerc:=1/rPageWidth; rPageHPerc:=1/rPageHeight; TBTL.x:=rPageWidth-(rPageWidth*.1); TBTL.y:=rPageHeight-(rPageHeight*.1); TBBR.x:=rPageWidth; TBBR.y:=rPageHeight; rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); Message(concat(rPageWidth,' ',rPageHeight,' ',rLScale,' ',outDrawingArea)); END; RUN(DrawToScale);
  10. Thanks to all, this has indeed gotten me started. Jesse I had previously read your tutorial but lost track of it, thanks so much. I have created the point pio I wanted and it pulls in the file name and has the fields as I planned. Right now I am writing code to get the layer scale and make it scale correctly with some math, is there a more elegant solution?
  11. I am having trouble finding a guide on creating plug in objects. I have built 20ish scripts that all work fine and would like to build a plug in object similar to the built in Reference Marker tool with custom parameters and layout. Can someone point me at a step by step guide or supply sample code I can look at? Thanks so Much
  12. NameClass('19MM PLYWOOD'); oops, found it! thanks!
  13. What is the vectorscript function to change the active class? I have written a script to make several parts and would like them to take on the class attributes. when I move them to with SetClass(H2, 'LAMINATE' ); for example, They move to the correct class but do not take on the pen colors.
  14. I have been reading with vectorscript documentation and some examples from the the forum, I can't seem to grasp how to correctly build the dialog handler and pass my collected data to variables outside it. this is what I put together for the uid, but all of my attempts at writing my own dialog handler or modifying others I have found have borne no fruit. I would like help with the code, but more importantly I would like to understand it. Teach a man to fish and all... {CABINET BUILDER V0.1} PROCEDURE CabinetBuilderDialogBox; VAR builderDialog:LONGINT; result:LONGINT; BEGIN builderDialog:=CreateLayout('Cabient Builder',false,'Build','Exit'); CreateStaticText( builderDialog ,1,'CABINET BUILDER V0.1',-1); SetFirstLayoutItem( builderDialog , 1); { ********** TAB CONTROL ********** } { Tab Group 1} CreateGroupBox(builderDialog , 5 , 'Cabinet Specs' , FALSE); CreateStaticText(builderDialog , 6, 'WIDTH',8); SetFirstGroupItem(builderDialog ,5,6); CreateEditReal(builderDialog, 7, 1, 0, 4); SetRightItem(builderDialog , 6,7,0,0); CreateStaticText(builderDialog , 8, 'HEIGHT',8); SetBelowItem(builderDialog , 6,8,0,0); CreateEditReal( builderDialog , 9, 1, 0, 4); SetRightItem(builderDialog , 8,9,0,0); CreateStaticText(builderDialog , 10, 'DEPTH',8); SetBelowItem(builderDialog , 8,10,0,0); CreateEditReal( builderDialog , 11, 1, 0, 4); SetRightItem(builderDialog , 10,11,0,0); CreateStaticText(builderDialog , 12, 'KICK',8); SetBelowItem(builderDialog , 10,12,0,0); CreateEditReal( builderDialog , 13, 1, 0, 4); SetRightItem(builderDialog , 12,13,0,0); CreateStaticText(builderDialog , 14, 'DOOR(S)',8); SetBelowItem(builderDialog , 12 ,14,0,0); CreateEditInteger( builderDialog , 15, 2, 3); SetRightItem(builderDialog , 14,15,0,0); {Tab Group 2} CreateGroupBox(builderDialog , 16 , 'Material Specs' , FALSE); CreateStaticText(builderDialog , 17, 'Material Thickness',8); SetFirstGroupItem(builderDialog ,16,17); CreateEditReal(builderDialog, 18, 3, 19mm, 8); SetRightItem(builderDialog , 17,18,0,0); CreateStaticText(builderDialog , 19, 'Laminate Thickness',8); SetBelowItem(builderDialog , 17,19,0,0); CreateEditReal( builderDialog , 20, 3, 0.039in, 8); SetRightItem(builderDialog , 19,20,0,0); CreateStaticText(builderDialog , 21, 'Kick Set Back',8); SetBelowItem(builderDialog , 19,21,0,0); CreateEditReal( builderDialog , 22, 3, 4in, 8); SetRightItem(builderDialog , 21,22,0,0); CreateStaticText(builderDialog , 23, 'Door Gap',8); SetBelowItem(builderDialog , 21,23,0,0); CreateEditReal( builderDialog , 24, 3, 0.125, 8); SetRightItem(builderDialog , 23,24,0,0); { Create tab control } CreateTabControl( builderDialog , 100); SetBelowItem( builderDialog , 1, 100, 0, 0); { Add the tab panes } CreateTabPane( builderDialog , 100, 5); CreateTabPane( builderDialog , 100, 16); result:=RunLayoutDialog(builderDialog,NIL); END; RUN(CabinetBuilderDialogBox);
×
×
  • Create New...