Jump to content

Script?


Recommended Posts

Can a script be written that will draw two break lines and at the same time draw a solid filled closed polygon behind the break lines with its line color set at white and then group all three items. I currently use these when drawing sections as they speed things up considerably. Move them anywhere on a section and they hide whatever is behind them, no need to draw wall breaks anymore!

VW designer 2009

Win XP

Link to comment
  • Vectorworks, Inc Employee

Hi Peter,

Yes. A script could be written to do this. I think the best solution might be to make it a path PIO that only shows a line with a break on visible line segments. This would allow the user to hide any segments you like by using the 2d reshape tool. It could also be saved (in common configurations) as red symbols.

Link to comment

Michaelk, the invisible polygon needs to follow the shape of the break lines so that everything outside the twin break lines is visible. What do you mean by a blue symbol?

Matt, I'm not sure what you mean by a path PIO, can you elaborate?

Pat, I have never written a script so please bear with me. Is your script, starting with Procedure and ending with (Test); typed exactly as written word for word and will the polygon follow the break lines profile? In the meantime I'm going to look into learning more about scripts.

Thanks all

Link to comment

The script I posted draws exactly one break line at the position 0,0 with no rotation using the default settings for the break line object. It does not draw a polygon at all.

I will have to think about how to convert the breakline to a polygon. Would just setting it to a really heavy line weight work?

When you do it manually how do you do it?

Link to comment

Pat, I create three entities, first I draw a break line using VW's break line tool, I then duplicate the break line and nudge the copy vertically from the original. Now I have twin break lines side by side that I use to create the third entity, a closed polygon. I snap to the points on both break lines creating a polygon that is inside or in between the break lines. The polygon's attributes are solid so it hides anything behind it as a section break does and it's line color is white so you don't see it's lines that cross from one break line to the other (all of this assumes one draws with a white background). When completed, you must move the breaklines to the front so that the polygon doesn't hide them. Group our new creation and drag where needed. No need to draw breaks in section walls for instance, just drag this where you want your break and you have it. Need to move a wall break to make room for annotations, just nudge this "portable section break wonder" to make room, it's fast and simple. Being able to create it with a script would be the icing on the cake so to speak.

Link to comment
  • Vectorworks, Inc Employee

Peter,

I use a similar idea as you but end up with just one polyline. The method I use is like this:

Create one breakline.

Option-drag a copy a desired distance away.

Ungroup both breakline objects so that they are now polygons.

While it may not be necessary, I then "Decompose" to turn them into lines.

Draw a line from the end of one breakline to the closest end of the other.

Select them all and "Compose" to turn them all into one polygon.

Give it a solid fill and hide the one segment visually connecting them.

While this method (and yours) does the trick, I like the idea of a PIO.

BTW: A PIO is a Plug-in Object. The breakline object is a good example of a linear (defined by 2 points) plug-in object. A path PIO is defined by a polyline (3 or more points). Using a path PIO for this could allow any segment to have a break and could also allow any segments to be hidden. I could look into creating this PIO when I have some time.

Link to comment

So how much bigger than the "break line" is the masking poly? The same height and with as the break portion? Or the size of the bounding box? Or something else?

I have read you post about 4 times Matt and it is just not making sense to me. How does this create an object that will block the line it is placed on top of?

It seems to me that what you need to do is draw a wide white line directly under the break line.

What am I missing?

Link to comment

I think you're right, Pat. I think Peter & Matt are talking about something like the attached.

Being a mere tinkerer and dabbler at these sorts of things, I did it with blue symbols.

I'd love to see it done w/ a PIO. Not that I have any need for it myself, I'd just like to see how it's done.

michaelk

Link to comment
  • Vectorworks, Inc Employee

Michael's example looks to be what Peter's method is. If you take only the masking polygon, make the line color black, and hide the two segments that connect the two break lines, you'll have my method. I use this most often with wall section details where I may draw the full wall section from footing to roof, but make the walls much shorter to get the details closer together. Then I plop these break line polys over the wall to show a break and it masks out what's beneath.

Link to comment
  • Vectorworks, Inc Employee

I played around a bit with creating a PIO and it's working pretty well. Download it from this link, add it to your VW plug-ins folder, and add it to your workspace:

http://panzercad.com/VW%20Freebies/plug-in_objects/break_poly_pio/

Only the straight break symbol option is available at this time. The PIO lets you create any polygon shape (it doesn't do curves) and shows breaks on any visible segments. It also has a Maximum segment length (without breaks) setting. The PIO will add multiple breaks along each segment as needed to keep the length between break less than this setting.

You could create typical configurations with this object and save them as "Red Symbols" in the Resource Browser.

Let me know what you think. :-)

Link to comment

Matt, I downloaded your Break Poly PIO, unzipped it and placed it in VW's Plug In folder. When I try to add it to my Tools in the workspace menu it does not appear on the list. I re-checked VW's Plug In folder and your PIO is right there next to the Break Line PIO. Could it be a version issue, I use VW's 2009?

Link to comment

Thanks Matt, your PIO works great once I figured out how to hide that part of the polyline that "connected" the two break lines. I've never used the hide segment feature in VW's polylines so it was a pleasant surprise.

Your creation is also superior to mine because I had to adjust the hidden polygon behind the break lines if I wanted to change the size of the break which was a pain! Your single entity idea eliminates the polygon. Nice work.

Link to comment
  • Vectorworks, Inc Employee

You're welcome Peter.

Yes, the hide segment feature comes in handy for this sort of task.

I'm glad you like the PIO! It's certainly one I'll be using from now on. :-)

Sooner or later I'll add the other break types to match the VW break line types...

Link to comment

Thanks so much for this simple PIO. I long ago wished for something like this and have been working around it ever since. At first VW use, I expected the break line tool to actually break the objects it intersected like the split tool, HA!

Not bloody likely......

EVERYONE BUY CAMERA MATCH!

Link to comment
  • Vectorworks, Inc Employee

Hi Peter,

I just looked at the PIO closer in VW 2009 and there are some issues. One is a bug that is mine (in the PIO), the other seems to be a limitation in VW 2009.

The one bug (that I don't think you experienced) is when editing the PIO within a symbol. The pio uses "page" units in it's parameters (ie: 1/8" means 1/8" in printed output no matter the layer's scale). When edited within a symbol, the PIO didn't know where to look for the appropriate scale. Now, it looks at the active layer's scale which is consistent to how other NNA objects work. I now fixed this problem.

The other problem seems to be a bug (or limitation) with VW 2009's path PIO's. In VW 2009, In my testing, the 2D reshape tool (in toggle visibility mode) doesn't work when editing path objects. The workaround is to edit the PIO's path object (by double-clicking on the PIO) and use use the 2D reshape tool on the source poly.

Get the updated (version 1.0.1) PIO here:

http://panzercad.com/VW%20Freebies/plug-in_objects/break_poly_pio/

Let me know if this solves your problem.

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