how to autosize textbox while updating text in dxf document using ezdxf - autocad

I am new to ezdxf. I have an engineering drawing in dxf format. I have to modify certain text in the existing document. I have the updations required in a dictionary. I loop through all the TEXT entities and comparing whether it is in the dictionary. If so, I update it with the corresponding value using e.dxf.set() method. But if the new string is longer than the enclosed text box, it passes across. Is it possible to autofit the surrounding text box by any means?

Related

Inserting image to slide with empty placeholder (PowerPoint)

I want to insert a picture to my slide, but if there is an empty placeholder, the picture automatically gets inserted into this placeholder.
Is there a way to tell PowerPoint to avoid empty placeholders when inserting a picture?
Best regards
Jesper
Is there a way to tell PowerPoint to avoid empty placeholders when inserting a picture?
No, but you can work around it by inserting your picture, getting a reference to the inserted shape, duplicating it, then deleting the original inserted shape.
The duplicate will be a picture, not a placeholder containing a picture.
That works most of the time; if your needs are more complex and/or you need to preserve the original placeholder, you'll need to add content to any empty placeholders, then insert your picture, then delete the added "bogus" content.

Openxml word insert image

I have an excel sheet converted to html, then HTML converted to word. There is one missing thing: images from excel sheet are in format of base64 string and they are overlay on table, not a part of cell. How can I add such images to my docx file?
I want an image overlay on table starting over a special cell (like E18).
1- Base64 string must be converted to memorystream to be used as image source
ImagePart imgp = mainPart.AddImagePart(ImagePartType.Png);
MemoryStream M = new MemoryStream(Convert.FromBase64String(o.Base64String));
imgp.FeedData(M);
2- Drawing object with anchor must be created to accommodate the image. Inline drawing is not useful. Anchor object helps flow image above text to any place.
3- Most samples on the net add the drawing to document or body or run.... For purpose of my question (reference point inside of cell), we easily add drawing to cell object.
This post shows adding drawing to cell object. This post shows use of Anchor object.

Convert string automatically to inline image

I'm using InDesign's data merge to generate playing cards for my game. Is it possible to convert a specific string to an inline image?
"You may roll :red_die: and add the rolled valued to this card's value"
For example the :red_die: in the text above would be automatically converted to an inline icon of a red coloured die.
No you can't this way. But you can place images with datamerge to the condition some fields of your source is set as an image one meaning having a "#" prefix. InDesign will process fields like #image as an image to place. It's up to you to add such a field in your source. However you can't nest it within another datamerge tag so it may not work eventually.
Other solution is using F/C dialog to replace :red_die: with clipboard content (your image) or to use scripting. You may also consider variable content plugin like EasyCatalog.

MS Visio 2010: Saving as .svg sets values to 0

I want to save my Visio shapes as an .svg file to incorporate into a XML document. However, when i save it ALL the values in my shape are set to 0. I've quadruple checked the shape data and all the values are there and the formulas are returning the correct values. The strange thing is, saving as a .svg works in Visio 2007 and all values are correct, but in Visio 2010 all the values are 0. Why is this? Unfortunately this is my first post, so I can't add screenshots as i don't have 10 rep.
The shape is 4 individual rows grouped together. The data is stored in the "Main" shape, i.e all rows grouped together. The cell in the individual shape then references its value from the main shape.
Example of 1 of the 4 main shape row forumlas:
ShapeData Property - Value = Sheet.1!Prop.Row_2 (references main shape rows, stores value)
Text Field Property - Value = Prop.Row_1 (references its single row, containing value of main shape)
The real kick here is I fixed this problem 4 months ago, but my colleagues had more shapes with the same issue. I cannot remember how i fixed it, and the shape that I fixed is identical in terms of structure and data handling.
Something strange that I also noticed is that when i type ".Value" after the Value field text in either the Text Fields or Shape Data properties, the ".Value" gets automatically omitted after I press enter, but then the field produces the right .svg output. However, this does not work when I make that change in the master shape. So effectively, I'd have to go into every single value field and manually type ".Value" and press enter for it to work. I've also tried turning off all shape protection, no joy.
I'm currently in the process of writing a macro to "refresh" all the value fields by adding ".Value" after them to mimic me manually typing that in.
Any help or feedback would be greatly appreciated!
I believe this is upgrade issue (2007->2010). Have seen this a few times. To fix try:
Open the diagram in Visio 2003 (or 2007), but not in Visio 2010
Save it as .VDX (Visio XML Drawing) file
Close it
Open the VDX file again in the same Visio
Save it back as normal VSD file. This should fix the broken VSD file.
Delete the VDX file, it is not needed
If this doesn't work then try sharing the source file (dropbox or whatever).
The problem was that the rows Text Fields were Data Object types. When I removed the Text shape protection and inserted a Shape Data field, the correct values were shown on the .svg output file.

VB6 RTF to Word 2010

I have a VB6 application which has RTF field that eventually gets copied and pasted to Word 2010 document.
Texts and pictures get pasted all nicely except when a chart element is pasted, it has axis labels hidden by default.
So I basically have to click individual chart and "show" axis labels.
Is there any way to make it visible by default?
Thanks!
You might need to expand on your question a bit for more specific details but it is possible using OLE Automation to manipulate the objects in your Word document from VB6. Here's a better sample than I could give you from memory: http://support.microsoft.com/kb/237337

Resources