Jump to content
Developer Wiki and Function Reference Links ×

SDK, getting Started.


Recommended Posts

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

Link to comment

If you only want to do Vectorscript, you do not need the Xcode SDK. You only need the SDK if you want to develop plugins in C++.

To create a new script in a Vectorworks file, just go the the Resource Browser, click the second down pointing black triangle on the right hand side (across from Resources) and select New Resource and choose Vectorscript. You will be asked to name a script palette and then the script. The script editor will open to a blank document. Once you close the script you can reopen it either from the Resource Browser or by holding down the Option key and double clicking it in the script palette.

Later when you are ready to create Plug-in Objects, you need to go to Tools:Script:Vectorscript Plug-in Editor. But I HIGHLY recommend that you play with scripts and get comfortable before moving on to PIOs.

Link to comment

Justin, my apologies if I insulted your VS skills.

But there still is no way to use VS under the SDK. It only works with C++.

I can't really help because I have not taken the time to learn C yet.

There is an SDK mailing list that you can subscribe to, but it has very low traffic. If it is at all like the other NNA lists, I am sure someone there will be very willing to help you get started.

http://www.nemetschek.net/community/mailinglists.php

Pat

Link to comment

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.

Link to comment

The SDK is how NNA creates its own tools. You have access to the mode bar if needed, of course all the functions in VS, but more importantly you have access to the OS which enables you to create system wide applications. Do you need to communicate with other apps, internet, or databases? In other words, it gives you access to other computer functions outside of VW.

The interface is very similar to event enabled plug-ins. You create and event loop and write the code for each type of event passed by VW.

I did experiment with the VW 8 SDK and was able to build and run a simple plugin on my last Mac. The problem for me now is that it requires a Mac, which I do not have, to create the resources needed for a Windows plugin.

The only reference that NNA offers is the SDK manual found in the SDK documentation

Link to comment

Miguel,

Correct me if I am wrong, but you could not write Vectorscript using the SDK. YOu had to write in a variant of C, correct?

My understanding is that only some of the NNA plug-ins are written in the SDK. Only those that are getting very slow under VS.

You get 100 times the power of VS at a cost of it being 10 times as complicated.

I would love to play with it, but I just don't have the time.

Link to comment

Correct me if I am wrong, but you could not write Vectorscript using the SDK. YOu had to write in a variant of C, correct?

For starters, it is a completely different language. C++ is based on the C language but follows the concepts of an Object Oriented Programming (OOP) environment. Every piece of a program is an object such as windows, buttons, and other interfaces with attributes and methods attached to (or encapsulated in) each object. Consequently, you cannot use the same VS (or Pascal) code in a SDK program but you can translate the code into C++ sintax and have the same functionality. Every procedure and function in VS will have an equivalent in C++ and then some. By convention, all function prototypes are listed in the header files (*.h) where you can examine what is available in the SDK.

My understanding is that only some of the NNA plug-ins are written in the SDK. Only those that are getting very slow under VS.

Being slow will be one criteria to convert to C++ but another will be functionality not available with VS. Among these are events and the mode bar. With events, lets say you want to highlight a valid object to click on, change to a custom cursor, or show some other information while you are hovering over or drawing an object. You could implement this behaviour during the tool click or draw event.

VS automatically calls the code to show the outline of an object plugin when you click on the tool button but you do not have access to this event and cannot modify the behaviour.

Link to comment

Thanks Miguel

I can't find a way to fully automate generation of PDF. I was thinking i could do this through SDK, from your explanation I am sure I can.

but;

time i have to learn c++:= NIL;

Still if there is a SDK guru out there I am sure there are a few scripters lurking here that would like to see a YouTube of how to set up and get going.

Link to comment
  • 5 months later...
Thanks Miguel

I can't find a way to fully automate generation of PDF. I was thinking i could do this through SDK, from your explanation I am sure I can.

What exactly do you want to achieve? Is it exporting to pdf? Then Here is a script I made for doing this in VS. The reason I made this script is that the commands for pdf exporting in VS are shattered when they operate together.

pages is an array of the names of the sheet layers or saved views.

PROCEDURE ExportToPDF(pages : DYNARRAY of STRING; inSeparateDocuments : BOOLEAN);
VAR
	currentPage, pageResult : INTEGER;
	firstPage, lastPage : INTEGER;
	firstBook, lastBook : INTEGER;
	activeLayer : HANDLE;

BEGIN
	IF AcquireExportPDFSettingsAndLocation(inSeparateDocuments) THEN BEGIN
		activeLayer := ActLayer;

		GetArrayDimensions(pages, firstPage, lastPage, firstBook, lastBook);
		IF inSeparateDocuments THEN BEGIN
			FOR currentPage := firstPage TO lastPage DO BEGIN
				IF OpenPDFDocument(pages[currentPage]) THEN BEGIN
					Layer(pages[currentPage]);
					pageResult := ExportPDFPages(pages[currentPage]);
					ClosePDFDocument;
				END;
			END;
		END ELSE BEGIN
			IF OpenPDFDocument('') THEN BEGIN
				FOR currentPage := firstPage TO lastPage DO BEGIN
					IF GetLayerByName(pages[currentPage]) <> NIL THEN BEGIN
						Layer(pages[currentPage]);
						pageResult := ExportPDFPages(pages[currentPage]);
					END;
				END;
				ClosePDFDocument;
			END;
		END;

		Layer(GetLName(activeLayer));
	END;
END;

Link to comment
  • Vectorworks, Inc Employee

Hi,

the easiest way to start with the SDK is to see the samples. Vectorworks 2011 SDK contain few samples of plug-ins.

1. Install XCode 3.2 on Mac and Visual Studio 2005 on Win.

2. Download the Vectorworks 2011 SDK

3. Inside the SDK zip file you'll find the samples. You should be able to compile the samples right out of the box.

4. Note! in order to run the samples in VW you need to have a short-cut (alias) in your Vectorworks' application 'Plug-ins' folder to the SDKLib output (there will be an output folder created when you compile a sample)

Also, in the Vectorworks SDK under WinTools you can find a wizard for the VisualStudio that will help creating plug-in projects.

I hope we'll be able to create more step-by-step samples or video one day.

Regards,

Vlado

Link to comment

Orso, I'm glad I can bring you a smile- its the least I can do to give you back the help you've given me. : )

There is a clear process above relating to how to get up and running with the SDK. It involves getting software from a specific site. Downloading it and installing it in a specific location. There are example files located within one of the downloads that can be complied. I have downloaded X-Code and the SDK but was lost from there. I would love to see a YouTube of the process of how to get set up and compile the first example. I'm not looking for a C++ education.

I think that the free new media of wiki, youtube etc provides incredible opportunity to distribute information and education. Last summer I took on an intern student. After 6 weeks tutorial he went from never touching code to learning what took me 7 years of trial and error. I'm convinced that tutorial and explanation of how why and when approaches are taken can only help the community.

Link to comment

Ciao Justin,

There is nothing one cannot learn. It's just a matter of time and endurance.

The problem is that -as Pat implied- this is not a process you get done in a few weeks. I calculated I would need some three months full immersion only to get through the very basic of C++. It's not only C++. You'd better learn C first. You need to fetch some deep knowledge of the systems too. I began many times already. Next time I'll be unemployed....

Personally I have a deep dislike of learning by videos. I prefer by far reading and searching alone. A good bibliography to get started, that's the thing. But I come from an educational system based exclusively upon books. Italian conservator, a mix between an architect and an archeologist, a detective for old buildings. People in this field are few and characterized by a boundless curiosity and a weird lonely analytic approach. The research is the target, for us.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...