Jump to content

Assembly

Member
  • Posts

    430
  • Joined

  • Last visited

Everything posted by Assembly

  1. When this tool is inserted into layers larger than 1-10 the text looks bad. I used to include a If layerscale<10 THEN textprocedure. I have revised the tool using the textPIO code in last post to sets the text to be 3mm for ViewPort scales 1-5. BUT, as above, when inserting it inserts the text is too big again. To work around this I included if IsNewCustomObject(pioHandle)=False Then TextProcedure. _____________________ PROCEDURE SECTIONFRAMING; Var layerhandle, pioHandle, pioRecordHandle, PioWallHandle: Handle; PIOlayerscale:Integer; pioName: String; text:boolean; Radius: Real; width: Integer; Depth: Integer; BEGIN; pushattrs; Nameclass('Section-Framing'); If (getcustomobjectinfo(pioName,pioHandle,pioRecordHandle,PioWallHandle)=True) THEN BEGIN; width:=pframewidth; depth:=pframedepth; layerhandle:=getlayer(pioHandle); PIOlayerscale:=getlscale(layerhandle); RRect(0,0,width,depth,5,5); setclass(lnewobj,'Section-Framing'); radius:=1; Moveto(radius,radius);Lineto(width-radius,depth-radius); setclass(lnewobj,'Section-Framing'); setlw(lnewobj,2); IF (plength='Continious') THEN BEGIN; Moveto(radius,depth-radius); Lineto(width-radius,radius); setlw(lnewobj,2); setclass(lnewobj,'Section-Framing');; END; {----TEXT------------------------------} text:= ptext; IF(text=true) THEN IF IsNewCustomObject(pioName)=False THEN BEGIN; textsize(5*5/PIOlayerscale); TextFont(GetFontID('Arial')); TextFace([]); TextFlip(0); TextRotate(0); TextSpace(2); TextJust(2); TextVerticalAlign(5); TextOrigin(width/2,0); BEGINTEXT; num2str(0,width) ENDTEXT; SetTextWidth(LNewObj,width); SetTextSize(lnewobj,0,50,5*5/PIOlayerscale); Setfpat(lnewobj,0); TextRotate(90); TextOrigin(width,depth/2); BEGINTEXT; num2str(0,depth) ENDTEXT; SetTextWidth(LNewObj,depth); Setfpat(lnewobj,0); END; END; popattrs; resetobject(piohandle); END; Run (SECTIONFRAMING);
  2. On testing my text size control object is not working on insert. The text is defaulting to being sized in relation to the layer it is inserted on. On editing the PIO it works perfect. I think I read somewhere that PIO's don't get a layer handle until after they have been insert. If so this would explain the behavior, as my calling getlayer will be NIL until after it has completed the insert... is there a way around this?.
  3. The above script has five parameters. 1) a String field for text. 2) A field to set text height in mm 3-4-5) Three options of layer scale the text may be viewed at.
  4. Procedure textpio; Var layerhandle:handle; layerscalestring:string; PIOrecordhandle:handle; pioHandle:handle; PIOwallhandle:handle; pioTextSize:real; PIOname, pioText: String; PIOlayerscale:integer; textheight:real; scale1:real; scale2:real; scale3:real; classstring1, classstring2, classstring3:STRING; BEGIN; classstring1:=Concat('Note-Text-',num2str(0,pscale1)); classstring2:=Concat('Note-Text-',num2str(0,pscale2)); classstring3:=Concat('Note-Text-',num2str(0,pscale3)); textheight:=ptextheight; IF getcustomobjectinfo(PIOname,PIOHandle,PIOrecordhandle,PIOwallhandle)=TRUE THEN BEGIN; layerhandle:=getlayer(PIOHandle); PIOlayerscale:=getlscale(layerhandle); layerscalestring:=num2str(5,PIOlayerscale); TextOrigin(0,0); Nameclass(classstring1); textsize(textheight*pscale1/PIOlayerscale); BeginText; Ptext EndText; Nameclass(classstring2); textsize(textheight*pscale2/PIOlayerscale); BeginText; Ptext EndText; textsize(textheight*pscale3/PIOlayerscale); Nameclass(classstring3); BeginText; Ptext Endtext; END; END; run(textpio);
  5. this is a point object with one string parameter: 'text'
  6. I'm having trouble with the above in that PIOlayerscale:=getlscale(PIOHandle); returns a value of 0.0000. anyone spot what is wrong?.
  7. Procedure textpio; Var layerscalestring:string; PIOrecordhandle:handle; pioHandle:handle; PIOwallhandle:handle; pioTextSize:real; PIOname, pioText: String; PIOlayerscale:integer; BEGIN; IF getcustomobjectinfo(PIOname,PIOHandle,PIOrecordhandle,PIOwallhandle)=TRUE THEN BEGIN; PIOlayerscale:=getlscale(PIOHandle); layerscalestring:=num2str(5,PIOlayerscale); TextOrigin(0,0); textsize(300mm/PIOlayerscale); BeginText; Concat (Ptext,'This is the scale 100 size',' ',layerscalestring) EndText; textsize(75mm/PIOlayerscale); BeginText; Concat (Ptext,'This is the scale 25 size') EndText; hmove(lnewobj,0,-50); textsize(15mm/PIOlayerscale); BeginText; Concat(Ptext, 'This is the scale 5 size') EndText; hmove(lnewobj,0,-70); END; END; run(textpio);
  8. Text size is controlled by layer. Is there a function to set absolute text size. What I'm thinking is creating a PIO that will be viewed at 2 scales 1-50 & 1-5 and using the Class to control visibility. Say Nameclass(Notes-Scale5) Nameclass(Notes-Scale50) For this to work I need to control the absolute size of the text regardless of the layer scale it is inserted on.
  9. So I tested these PIO in 2009.... IT WORKS!. i even get the dotted screen image. I will need to test it in a few instance before I have full confidence, but from this evening I think this is a could be very useful.
  10. Note also now I used CreateCustomObjectN, This allows me to suppress all the nested object parameter settings on first insert. Still no joy and only stranger behavior. Starting in a new file on first insert objects created on the 'None' class appear for the first instance of the PIO inserted. On the second insert only the Locus shows up. So I created a menu script to add all the classes for the objects nested. First insert the PIO shows up... but again second insert only the locus. Third insert generates the second... and so on. ???.
  11. This is how I changed it: PROCEDURE Insertother; Var PIOHandle: handle; PIOrecordhandle: handle; PIOwallhandle: handle; hobject: handle; hframe: handle; width:String; PIOname, objectname,head,sill:string; BEGIN; IF (getcustomobjectinfo(PIOname,PIOHandle,PIOrecordhandle,PIOwallhandle)=TRUE) Then locus(0,0); sill:=num2str(0,psill); head:=num2str(0,Phead); width:=num2str(0,pwidth); objectname:='AluminWindow40'; hobject:= CreateCustomObjectN(objectname,0,0,0,False); SetRField(hobject, objectname,'sill',sill); SetRField(hobject, objectname,'head',head); SetRField(hobject, objectname,'width',width); objectname:= 'SectionTimberCavityWindow'; hobject:= CreateCustomObjectN(objectname,0,0,0,False); SetRField(hobject, objectname,'sill',sill); SetRField(hobject, objectname,'head',head); SetRField(hobject, objectname,'width',width); objectname:='Framing'; hobject:= CreateCustomObjectN(objectname,0,0,0,False); SetRField(hobject, objectname,'framewidth','40'); SetRField(hobject, objectname,'framedepth','width'); Resetobject(PIOHandle); End; RUN (Insertother);
  12. Above is the original script cut and paste. very strange behavior. Test 1 I insert (#1) PIO I only get the locus. I insert (#2) PIO, (#1) draws?!. Test 2 I insert (#1) PIO I only get the locus. I draw some lines and other objects I insert (#2) PIO, (#1) draws. Now to try CCrofts suggestions.
  13. PROCEDURE Insertother; Var PIOHandle: handle; PIOrecordhandle: handle; PIOwallhandle: handle; hobject: handle; hframe: handle; width:String; PIOname, objectname,head,sill:string; BEGIN; locus(0,0); sill:=num2str(0,psill); head:=num2str(0,Phead); width:=num2str(0,pwidth); objectname:='AluminWindow40'; hobject:= CreateCustomObject(objectname, 0,0,0);Hmove(lnewobj,0,0);Resetobject(lnewobj); SetRField(hobject, objectname,'sill',sill); SetRField(hobject, objectname,'head',head); SetRField(hobject, objectname,'width',width); objectname:= 'SectionTimberCavityWindow'; hobject:= CreateCustomObject(objectname, 0,0,0); SetRField(hobject, objectname,'sill',sill); SetRField(hobject, objectname,'head',head); SetRField(hobject, objectname,'width',width); objectname:='Framing'; hobject:= CreateCustomObject(objectname, 0,0,90); SetRField(hobject, objectname,'framewidth','40'); SetRField(hobject, objectname,'framedepth','width'); End; RUN (Insertother);
  14. i'm not at my script, but you might be correct. i was lazy and used lnewobj as the handler. that is likely to get an object from in the childpio and not the PIO itself
  15. if you are working on 2009, you can set the path to prefernce files. this includes workspaces.
  16. thanks all who posted. im cranking out a contract set this week and will have a crack soon. yes i read and re read all references. I think learning VS is mainly from trail and error. i look at my first scripts and think 'what a mess'. entering into new area that is know to be 'more difficult and risky' it would be good to see a basic complete script rather than snippets.
  17. yes i have placed a locus so i know where the main (Parent)pio is. it draws fine. History. I have a WallSection tool that draws timber framing, bottom plates, top plates, studs, lining, cladding, insulation. Medium complexity script. Very useful for quickly putting a section togeather. it is a line PIO. I have found on the last couple of projects that I have to ungroup the tool, so that I can edit the parts when it came to detailing. The ungrouped tool becomes static lines and rectangles... So I then start to draw with other custom PIO's FramingPIO, PlyPIO etc etc. As a note I draw this in a symbol with the bottom plate at the 0,0 point. The Y value of the top plate then tells me what my RL to FFL is which I find very useful. I like the controll I get in the symbol. So instead of using a line object, I started out scripting a new point object. At the same time I started building into it the ability to draw an Aluminium Window in section, with all the detail our building code requires. I structure my tools such that all components are defined Procedures, then Begin and Call the procedures. I worked it to the point where the PIO will draw the timber work, The building wraps, the cavity with closer, the cladding, the window head flashings with second layer of building wrap, and the cladding with its flashings. I started on the aluminium window section by exported a script with the detail window section drawn in a symbol, cut and paste the polylinescript. One profile is a polyline of 100's of points, so to keep TimberSection script clean I started a new PIO to create the AluminiumWindowProcedure. It was then I wondered if it was possible to nest the two components into a new PIO. In terms of parameters it is all pretty straight forward. Topplate, Windowsill Windowhead FrameSize. The script takes care of sizing most parts. The Parent PIO once regenerated work perfectly. The best part is that it can be ungrouped, leaving the childern PIOs. To me this has great potential. All the mini procedure -ie Head Flashing. Sill Flashing framing could be child PIO's to, so for special situations the script can rough out the section, it can be ungrouped and instead of dumb polylines I can then tweek the components. So now if only I can get it to draw correctly on the insert.
  18. thanks for the links and the references, example 4 looks like a starting point... but surly someone has a more complete a bigger example they could can share. what does it look like to be able to accept values and set parameters in a dialog???.
  19. wait... rest object did not work, my pio still does not draw on isert, only after an edit. anyone else?.
  20. After 5 years of PIO scripting I have a fair idea of the workings to make a good PIO. As an NZ architect we use a lot of timber construction, a timber framed wall is made up of a number of components, IE Frame, linging clading, insulation. I have scripted objects for most of these individual objects, I also scripted a PIO that draws a Section through a wall. I use this all the time to quickly generate good looking drawings for developed design. However when I move onto Detailed design I pretty much have to draw over the top with the Component individual Objects. I recently used CreateCustomPio to combine a the component PIO to make a TimberWallSectionPIO; LiningPIO, CladingPIO, InsulationPIO. I now have the ability to ungroup/convert the higher level TimberWallSectionPIO and have access to the smaller components if any adjustment needs to be made. (There are many more components like flashings also). However doing this is adding a long list of parameters to the TimberWallSectionPIO. I'd like to learn how to use a dialog, similar to the new Window and Stair tool. Looking at the function list it looks scary. Can someone with a bit of experience post a sample of the basics?. I'm sure others in this fourm would be interested. If you could use the example to draw simple rectangle, that has a dialog button on the PIO info window. Use of dialog changes the values of the width and height of the rectangle. Many thanks to the guru who provides this post.
  21. i used createcustomobject to mave a PIO that combines two of my other pio's. on insert nothing appears on the layer. edit a parameter and the objects nested in the new PIO become visable. This is a useful function. how do I get it to generate properly on insert? anyone know what these do? EnableParameter SetParameterVisibility
  22. It would be good to have the option of grey other objects while editing a group, even better if you can snap to objects outside group while editing.
×
×
  • Create New...