Jump to content

creating plug in objects?


markj

Recommended Posts

Hi there, I need to be able to create a library of plug in objects. These will be basically two concentric rectangles which represent the plan view of a box with a fixed wall thickness. I need to be able to create a library of these, which will have different names, and database/record attatched to them. Ultimately I will create hybrid symbols/PIOs from these as I create the elevation views.

My question is how do I best do this? - The 'boxes' will need to be repeated on the drawing, and some will need to be resized, but still retain the attatched database.

Where do I create the library - at the moment I have a drawing file with them all on and saved as symbols - converting them to PIOs would presumeably allow the resizing. is this the best way? and how do access them as PIOs?

When the objects are resized, I need to be able to keep the wall thickness (ie not resize that part of it).

I would imagine this could be done with a Vectorscript - but I am a complete beginner here, so If someone could point me in the right direction......Thanks, Mark

Link to comment

The best way to get started with Vectorscript is to look at examples. There are some in the Customization section of this website. You can also download PIO's from vectordepot.com and open these files in a text editor to see the code. And of course there is the Vectorscript secton of this forum.

What you wish to do is accomplished thru code (vectorscript). PIO's draw themselves thru parameters such as height,width and depth. These values are used by functions within the script to draw circles,rectanges,lines and so on. Other functions operate on these objects, such as extrude,group,fill,etc. Records can be attached and filled out with vectorscript.

Plugins are little text files and are accessed by putting them in the plugins folder and adding them to your workspace.

You should also take a look at Vectorscript Language Guide and Vectorscript Function Reference available thru help.

You could start by writing a script that would draw a rectangle and then go step by step from there.

With bone-headed determination and lots of trial and error you will gain the knowledge needed to create your tools. It will take some time tho, unless you have some experience with writing code already.

Hope this works out for you.

Charles

Link to comment

Yeah, I think they just renamed it when it became too powerful for the mini prefix.

Minipascal....therein lies another clue. Vectorscript is base on the programming language Pascal. I found a turorial type book on Pascal which helped me a lot.

Not sure what's in a plug-ins folder from V6, but if there's something there it won't be encrypted, meaning you can open these in a text-editor to see their makeup. This is quite convenient as you probably already know what they do.

Charles

Link to comment
  • 3 weeks later...

More help required! -

I have so far managed to get minicad6 (minipascal) to draw a rectangle something like I want, ie:

Procedure Draw

VAR

Click1X,Click1Y,Click2X,Click2Y:REAL;

BEGIN

GetLine(Click1X,Click1Y,Click2X,Click2Y);

Rect(Click1X,Click1Y,Click2X+520,Click2Y);

Rect(Click2X,Click2Y,Click2X+520,Click2Y-18);

Rect(Click1X,Click1Y,Click2X+520,Click1Y+18);

Rect(Click1X+520,Click2Y-18,Click2X+520+18,Click1Y+18);

END;

Run(Draw);

This will draw a rectangle one side of which is dragged along a line, the width being set at 520mm. There are also some other rectangles to 3 sides which constitute the sides to the box.

I need to be able to do this in Vectorscript, but cant get it to work as a line, rectangle, or point object.

What I need to be able to do is drag a line (vertically, horizontally, or other) which creates one side (length) of the rectangle, the other side (width) is then dragged out, but will default at say 520mm.

It can't really be that difficult, but I am floundering!

The nearest thing I can find to modify is a tool which will drag a rectangle out from a centre line. I can modify this to draw half of the rectangle but this is not really satisfactory.

I am sure this question has been asked a million time already; but how can I learn the basics? - Is there anyone who can offer a bit of online tutorial??

Thanks

Mark

Link to comment

Mark

This thread really belongs down in the vectorscript section.

I don't have a lot of time right now, but I can see why it's not working. You're missing a semi-colon after 'Procedure draw'.

This is a very common kind of mistake. If you don't conform to the syntax rules of VectorScript your scripts can't run. It is an extremely exact language. Spend some time with the VectorScript Language Guide.

In the top left corner of the VectorScript editor is a little gear-like icon. Click this and the editor will take your script for a little pre-flight check. If there is an error you can click to view it. These messages can be a bit cryptic, but in this case it's pretty clear.

Keep at it

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...