Jump to content

Assembly

Member
  • Posts

    430
  • Joined

  • Last visited

Everything posted by Assembly

  1. I am trying to print / export a PDF file. I am using (full script Below) AcquireExportPDFSettingsAndLocation This launches a dialog window that I then have to manually set the file location and click okay... I want all this automated, how?. Is there a way to tell a Dialog what settings they are. If so is there a way to find out what the dialog settings are so I can tell them. Anyone else have a method of exporting PDF or Image files that can be fully automated?.
  2. Thanks Pat. I may be confused as to what SDK is and does...I really don't know. I know it is written in C... I thought that the Vectorwork Software Development Kit makes the VS functions and procedure accessible at a higher level. I am keen to know more so can anyone using SDK give us some more insight.
  3. So I downloaded the SDK followed instructions to install Xcode... now what??? Could some one please post a YouTube on how to get started with SDK. From download, setting up Xcode, installing the Vector script SDK (if that is required) + an outline of how to use Xcode to create scripts. PLEASE
  4. Raymond I looked at Reshaper- looks like this is for Windows platform, and for coding C?. Your signature says your on a macMINI. Do you use Reshaper on Mac.
  5. I'm trying to use an {$Include} Inside an included file. IE PIO Says {$include /Drive/Object.txt} Content of Object.txt Procedure Example; Begin {$include /Drive/ObjectDrawRect.txt} End; Run(Example); Content of ObjectDrawRect.txt Rect(0,0,500,500); It does not seem like the nested include works. Anyone know anything or know how to get this to work?.
  6. Agreed There should be a MirrorLine(x1,y1,x2,y2); And MirrorLineH(ObjHand,1,y1,x2,y2);
  7. Procedure ChangeThis1; VAR i: Integer; Result: BOOLEAN; Result2: BOOLEAN; BEGIN; Result:=AcquireExportPDFSettingsAndLocation(true); Result2:=OpenPDFDocument('/Pdf/Here/niw'); i:= ExportPDFPages('0test'); i:= ExportPDFPages('1test'); message(i); ClosePDFDocument; END; Run (ChangeThis1);
  8. use pastebin.com or post the a text file of code. A trick I use for this type of tool. Define each profile that you might extrude as its own sub routine. Ie PROCEDURE DrawASquare; PROCEDURE DrawACircle; Then Create a selector Procedure ie Procedure DrawProfile; Begin; If pPopup='Square' THEN DrawASquare; If pPopup='Circle' THEN DrawACircle; End; Finally to draw your extrude Procedure MakeExtured; Begin; BeginXtrude(0,pLinelength); DrawProfile; {This uses logic to select which profile to be drawn to be extruded. EndXtrude; End;
  9. um long explanation I don't understand. If what you want is to be able to schedule your plugins with a worksheet it is straight forward. Open a new file. Draw your plug in Use Create report Search for objects with your plug in records attached. This will list all plugins of the type. From there you can play different DB criteria to get what you want. ReText Placement x:=plinelength/2;
  10. If you do want to learn VS then you will spend many hours scratching your head wondering why your script is not working. Read your error messages carefully. It did tell you that it Expected ; ... as Miguel tells you above. You will spend hours looking for small and simple syntax errors as you learn the language, but if you persevere working through the error list becomes quick indeed. Miguel is correct, you can use extrude along a path. This may or may not be the best way to do what you want. I prefer to extrude and place my object, I do some quite complex geometry and as it is second nature I like this method. Your script is almost there BUT i would suggest you do it each step of the way. Understand how each part works then move on to the next step. Your have the correct structure in drawing the object between the Beginxtrd and Endxtrd. Note also the finer point I made in Step 4 about rotating object in one go. Or using the rotate object twice. Keep going you are almost there.
  11. Thanks.. ...so where do you start to learn applescript?.
  12. Yancka Welcome to the world of wondering what Vector Script Can do for you. To get started go to your VectorWorks Help. This should open in your web browser. file:///Applications/Vectorworks%202009/VWHelp/wwhelp/wwhimpl/js/html/wwhelp.htm There is a section called-Vector Script Language Guide. This is where to start. I recommend you use an external editor to write your scripts. I use BBedit- you can trial for 1 month free. Alternatively there is TextWrangler for free. The advantage of these are they have all the Functions programmed, when you type in a function the text turns blue. This will save many hours looking for one letter misplaced that will break your code. The tool you want to make is quite simple in VS. It should take a couple hours to write and test. BUT If it is your first it will take you up to a week. Recommend process for you to explore. Step 1. Create a line tool object that simply draws you a line. Get it working so you can stretch the line. Step 2 Figure out how to Draw the section you want to extrude. Suggest you start with a simple box. Then add complexity of how to draw a complex polyline. Step 3 Figure how to use the BeginXtrd and EndXtrd to extrude object you had drawn Step 4 Use Set3DRot to rotate the extrude into the correct plane. Note you may need to do this in two steps. You will get a different result if you rotate about both X&Z in one step, than if you rotate first about X, Then second rotate Z. Step 5 Use Move3Dobj to move the beam up in the Z value as needed. At this point you will want to add a parameter to the plugin that represents the z Value. Note Steps 4 & 5 both require you to have a Handle on the object you are rotating / moving. I use a generic hObject as my handle. I would use hObject:=lnewobj; after creating the extrude. Step 6 Add Text use TextOrigin, BeginText and EndText to create a text object. If you want to use the Z value from the object parameters you will need to covert the number to a String with Num2Str. Good Luck
  13. New to applescript. I think I know what is going on- Q1) Can you give a bit of description of what this is doing?. Q2) Can you use apple script to say: Open Vectorworks Draw a line Print the drawing Close ?.
  14. I wonder just how may times I will have to ask...
  15. Use tools > Reports > Create Report. List all: objects with a record. Listing objects with record: Framing Member This should start you on the path to getting a worksheet with roof framing
  16. Great that you acknowledge this Jeffrey. Now a few months have past can you post where this is documented.
  17. WISH LIST: When Searching Criteria it would be good to be able to exclude objects inside View Ports.
  18. And Again Can we have a full list of function available for worksheets please. You have documentation for VectorScript, why not worksheets?.
  19. VW will all ways draw the 2D information in layer over the 3D. To work around this you can: Make two Viewports. One for the 2D stuff One with the 3D objects. Put the 3D VP in front of the 2D VP.
  20. What specific information is required by the consultant. Does a consultants who is doing drainage layouts require information about beds in the first place?. It will be much easier to manage your end to strip out what is not useful...i hate getting ACAD files filled with lots of layers from consultant. ( I have equal complaints about getting drawings filled with other office layer systems). Suggest On EXPORT you Do not export invisible classes. Do not export 2D Fills or hatch patterns. Do Export line weights to colours. This will thin out the DXF to have only the relevant info for your consultant.
  21. I have notice the default settings for the values has Text left justified in a cell Number right justified.
  22. B1 is the value of the sum of b1.1-B1.10 When DB headers are on you see this. As Michalek said =B1 will do it. I don't think you can get independent access to any of sub fields. IE 1.05. You can change the order of the field, VW want 'track' where the field moves. The work sheets are not 'smart' like that- IE in excel if you drag a value in one cell to another, a formula that references the cell will update to follow the change. Hence we in our spread sheets we use long entry for database quires. What I mean by that is in your example. A1 is =('Lighting Device'.'Fixture ID') and B1 is =('Lighting Device'.'Fixture Cost'), We would not use C1= A1*B1 We would use C1 = ('Lighting Device'.'Fixture ID')*('Lighting Device'.'Fixture Cost') (I know you would not actually use this formula, but it shows what I mean).
  23. Again Can we have a full list of function available for worksheets please. You have documentation for VectorScript, why not worksheets?.
  24. Thanks Josh. ReadLn Makes sense. XML looks like it might be for me... I've had a read of the documentation. The Functions look not to scary. I cut and paste the ran the script below. I don't quite get how the file path works with this. I presume it still needs the PlatformFileName procedure from above. Can some one outline what the steps are to set the file path?. PROCEDURE WriteXML; {Writes data to an XML file.} CONST kAppFolder = 1; VAR hXML :LONGINT; xmlFile :STRING; result :INTEGER; elementResult :STRING; attributeResult :STRING; pathResult :STRING; cdata :DYNARRAY [] of CHAR; BEGIN ALLOCATE cdata [1..1024]; cdata := Copy('00 01 02 03 04 05 06 07', 1, 23); cdata := Concat(cdata, Chr(13), '08 09 10 1a 1b 1c 1d 1e'); cdata := Concat(cdata, Chr(13), '1f 20 21 22 23 24 25 26'); hXML := InitXML; IF hXML <> 0 THEN BEGIN xmlFile := 'XML Test File.xml'; result := CreateNewXMLDocument(hXML, 'XMLTest'); result := SetElementValue (hXML, '/XMLTest/Tools/Computers/Platform/Macintosh/CPU', 'G4'); result := SetElementValue (hXML, '/XMLTest/Tools/Computers/Platform/Macintosh/Disk', 'SCSI'); result := SetElementValue (hXML, '/XMLTest/Tools/Computers/Platform/Windows/CPU', 'P4'); result := SetElementValue (hXML, '/XMLTest/Tools/Computers/Platform/Windows/Disk', 'EIDE'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Computers/Platform/Windows/CPU', 'Speed', '3.0 GHz'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Computers/Platform/Macintosh/CPU', 'Speed', '1.2 GHz'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Computers/Platform/Windows/Disk', 'Size', '300 GB'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Computers/Platform/Macintosh/Disk', 'Size', '450 GB'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Hardware/Screwdriver/Regular', 'Head', 'Flat'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Hardware/Screwdriver/Philips', 'Head', '4-point'); result := SetElementValue (hXML, '/XMLTest/Tools/Hardware/Wrench/Fixed/Units/Metric', 'mm'); result := SetElementValue (hXML, '/XMLTest/Tools/Hardware/Wrench/Fixed/Units/English', 'inches'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Hardware/Wrench/Non-fixed/Adjustable', 'slide', 'Horizontal'); result := SetAttributeValue(hXML, '/XMLTest/Tools/Hardware/Wrench/Non-fixed/Monkey', 'slide', 'Vertical'); {Write some CDATA strings} result := SetCDATA(hXML, '/XMLTest/Tools/BinaryData/MiscData', cdata); result := WriteXMLFile(hXML, kAppFolder, xmlFile); Message('result: ', result); result := ReleaseXML(hXML); END ELSE BEGIN SysBeep; Message('Could not initialize XML reader.'); END; END; Run(WriteXML);
  25. I've been working on using an external file to keep and access information for record entries. Specifically a Costing Record. My process was to create a record file with it's fields. Created a worksheet to enter different values for the record. Exported the worksheet as a comma separated file: Costing.txt The PIO's will generate and self attach the costing record. The costing record access the external file and brings in the Cost Rates & Labour Rates. The reading of the file and extracting the wanted data feel like it should be easier. The CheckForEntry procedure goes through chr by chr to find the comma's. The position of the Commas is kept in an Array. THe content between the arrays is extracted out. I wanted to use a TAB separated file but ReadLn and Read seem to read the TAB as a new line. Anyone have experience with Read on TAB files. Specifically is there an easier way to pull the info?
×
×
  • Create New...