Solved

AutoCAD scaled block doesn't scale annotation text


Badge +1

When I insert a block using the DWGstyler I need to scale the block by approximately a factor of 1000. I noticed that when I do this the annotation text doesn't appear to scale the way it would if you inserted the block in AutoCAD manually then updated the x and y scale factor. Is there a workaround for this so that both the block geometry and the annotation scales with the DWGstyler scale factor?

Example Workbench:

icon

Best answer by mygis 21 June 2017, 10:02

View original

12 replies

Badge +8

Hi @jstanger ,

Would you be able to share your workspace with us?

Thanks.

Lyes

Userlevel 4
Badge +25

Have you tried the TextPropertySetter transformer? That's what occurred to me first. Otherwise we might need to check the format attributes that exist on the features when you inspect them. They should tell the story of what is happening.

Badge +1

Have you tried the TextPropertySetter transformer? That's what occurred to me first. Otherwise we might need to check the format attributes that exist on the features when you inspect them. They should tell the story of what is happening.

The TextPropertySetter rejects the input features because they are point geometries that are being used as insertion points for the AutoCAD blocks. It is the annotative text that is part of the AutoCAD block that I need to be scaled along with the block itself. The annotative text is being populated in AutoCAD by creating the appropriate attributes but the text itself is placed at the original scale (i.e. say 1000 times too small). When the block is manually inserted in AutoCAD and the block scale parameter modified the annotative text does scale as expected.
Badge +1

Hi @jstanger ,

Would you be able to share your workspace with us?

Thanks.

Lyes

I can probably create an example workspace if I can track down an open dataset of point data. The current workspace this a tiny part of is approximately 1000 transformers in size and depends on a significant amount of commercially sensitive data.
Badge +8
I can probably create an example workspace if I can track down an open dataset of point data. The current workspace this a tiny part of is approximately 1000 transformers in size and depends on a significant amount of commercially sensitive data.
That would be good. Thanks

 

Perhaps your new workspace would work ;)

 

Badge +1
That would be good. Thanks

 

Perhaps your new workspace would work ;)

 

I have attached a workspace, it produces two DWG files using a template file with a pre-defined block. One file has no block scaling and the other scales by 1000 demonstrating the annotative text doesn't scale. I have also included a DWG with the same block inserted manually then updating the block scale parameter to 1000 showing the text scaling. This uses data from the FME training set.

 

 

Badge +8

Hi @jstanger ,

Thank you for sharing the workspace. In my case I would create the text directly into the DWG file setting up the text properties I want rather than scaling the existing text. In AutoCAD you would click on the drawing, set the font and size, perhaps you could try the same approach?

Please let me know if this works for you.

Badge +1

Hi @jstanger ,

Thank you for sharing the workspace. In my case I would create the text directly into the DWG file setting up the text properties I want rather than scaling the existing text. In AutoCAD you would click on the drawing, set the font and size, perhaps you could try the same approach?

Please let me know if this works for you.

Yes, that was my backup plan. As the block is being used by the customer to run additional AutoLISP scripts I would still need to populate the block attribute but I was planning on scaling some text and just adding it to the appropriate layer as it would visually be essentially the same.

 

 

If this is the best option available to me then I'll use that method. Unless you are saying that the text option in the DWGStyler would act on the annotative text of the blocks?

 

Badge +8
Yes, that was my backup plan. As the block is being used by the customer to run additional AutoLISP scripts I would still need to populate the block attribute but I was planning on scaling some text and just adding it to the appropriate layer as it would visually be essentially the same.

 

 

If this is the best option available to me then I'll use that method. Unless you are saying that the text option in the DWGStyler would act on the annotative text of the blocks?

 

Hi @jstanger ,

 

 

the idea is to control the text properties from there so you can get the text size and font correctly. Another way would be perhaps to use the MaptextLabeller which is powerful when it comes to labelling in different formats but you need to pay extra money for it. You can ask Safe to provide you with a demo license to test it out.

 

Cheers.

 

Badge +1

Hi @jstanger ,

Thank you for sharing the workspace. In my case I would create the text directly into the DWG file setting up the text properties I want rather than scaling the existing text. In AutoCAD you would click on the drawing, set the font and size, perhaps you could try the same approach?

Please let me know if this works for you.

After some experimentation, I have found that there appears to be no method to scale the annotative text that is part of a block definition when inserting the block using the AutoCAD DWG writer.

 

 

Until the AuotCAD writer is changed, as @gisinnovationsb suggests the best workaround is to recreate the required labels as separate text objects and insert next to the block. If the original block is very small and the scaling is quite high then you won't see the annotative text on your drawings and the block will have the appropriate attributes.
Badge +8
Thank you for your feedback and sharing your solution with the community @jstanger

 

 

Hello,

You can expose the textheight of the attribute: autocad_<attr_name>_height

see

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/acad/Inserts.htm

this worked for me

Reply