.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to scale a polyline but keep its width constant?

2 REPLIES 2
Reply
Message 1 of 3
philip.trinidad
1001 Views, 2 Replies

Is it possible to scale a polyline but keep its width constant?

Hi,

 

I have a polyline that has been inserted into a block.  I want to scale the block so that the start and end points of the polyline can change but the width of the polyline remains constant.  Is there a way to do this?

2 REPLIES 2
Message 2 of 3

The problem you have is that blocks are designed for efficiency - they store the geometry once in the blocktablerecord and then the blockreference applies a transformation matriix to that same geometry to scale, rotate, translate, etc. all the geometry in the same way. Because this is how blocks are designed, you will have a lot of work to make a polyline in the block behave as you want. Some things you could try:

 

1. See if dynamic blocks are suitable for you - they are designed to allow individual block references to be modified in controlled ways that defined as part of the block definition.

2. Look into the Overrule API - to overrule the BlockReference to allow you to customize how it draws the entities stored in the blocktablerecord. However, this could become complicated, and forcing each block reference to draw itself differently can have a huge (negative) impact on performance for a large DWG.

3. If the polyline has constant width, can you use lineweights instead of polyline width?

4. Don't include the polyline in the block. Find some other way to associate the two geometries together - maybe through geometric constraints?

 

However, these are just some suggestions. Perhaps someone else on the forum has already done this and has more specific advice.

Cheers,

Stephen Preston
Autodesk Developer Network
Message 3 of 3

No, there's no way to have variations in properties like polyline width across multiple instances of a block that contains it.

 

Long ago, there was some discussion about view-dependent properties (like polyline width), but I think custom lineweights and annotation scales became the chosen solutions for that need. My guess is that dynamic blocks would be one way to solve the problem you have.

 

One word of advice about the use of custom drawing via DrawableOverule, which really should be noted whenever DrawableOverrules are suggested as a solution (but rarely is), is that you have to remember that the visual representation of a drawing that has custom graphics will only appear when your extension is present and loaded, and that means AutoCAD only. IOW, you will not see the same drawing in AutoCAD LT, or any other product that displays DWG files, whether it be from Autodesk or others, that cannot load your extension (e.g., none that I know of).

 

And, even with the required version of AutoCAD, if you collaborate with consultants or others who are using it, you will not only have to send them the drawing with the custom graphics, but also the managed extension that provides the custom graphics. And of course, you will have to support its installation and use with your collaborators.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost