Converting Microstation 'Tree' Font

Converting Microstation 'Tree' Font

Anonymous
Not applicable
1,940 Views
7 Replies
Message 1 of 8

Converting Microstation 'Tree' Font

Anonymous
Not applicable

We convert Microstation dgn files we receive from our state DOT into Autocad drawings all the time.  In the past the dgn files had a tree block that converted into Autocad without a problem.  Lately, and possibly to make it harder to convert to Autocad, the tree symbols in the dgn files are now a font. Converting into Autocad 2016 changes these ‘tree fonts’ into the letter N for some reason because there is no such thing as a tree font in Autocad to convert to.  The tree is the exact same symbol as in the past but now a font instead of a block. The height of the font determines how large the tree symbol looks.  And the height is in 4 decimal places making it hard just to find and replace. Most of our topo drawings have over 1500 of these tree fonts making it very difficult to single handily insert a tree block on each letter plus also resizing the block.

 

I do not believe one can make an Autocad font out of blocks/shapes but hope I am wrong. I have tried taking the old tree block and making it into a shape file.  I tried compiling this shape into a .shx but it doesn’t work naturally since it is not a font.  Any ideas on how to work around this would be appreciative since we are more equipped in house for Autocad instead of Microstation. 

 

Thank you.

0 Likes
Accepted solutions (1)
1,941 Views
7 Replies
Replies (7)
Message 2 of 8

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

When you recieve the files what format are they in? If they arein AutoCAD format already, perhaps you can ask for the DGN file as well. You should be able to open the DGN file in AutoCAD and perhaps capture the tree cell/symbol and copy/paste into AutoCAD.

 

Also, if you have some sample files that you could attach, I would be happy to investigate other possibilities.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks for responding back so fast.  DOT does give us dgn files only.  We either use Autocad to convert to dwg or we have one seat of Microstation that we use to save to Autocad format. I am attaching both files (dgn and the dwg converted from dgn) for you to look at.  Notice all the trees in the Autocad file are now letter N and list as a font style but in Microstation it looks like a tree block that they have used before. I am also attaching the tree block that we use to get once we went through the conversion process.

 

Tried sending all three files and had it returned because it says "dgn is not a valid extension for an attachment".  I zipped all three files into one then.

0 Likes
Message 4 of 8

john.vellek
Alumni
Alumni

HI @Anonymous,

 

 

 
I played with this and decided that SHP and SHx files were not the way to go.
 
I found a LSP routine on the web and modified it for your dwg.
 
(defun c:txttoblk( / ss)
(vl-load-com)
(setq blk "TREE") ; Put block name here, with directory if block is not already in drawing
(setq ss (ssget "X" '((0 . "TEXT")(1 . "N"))))
(if ss
(progn
(setq ss (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
(mapcar '(lambda (x) (vl-cmdf "-insert" blk (cdr (assoc 10 (entget x))) 1 1 (* (/ 180 pi) (cdr (assoc 50 (entget x)))))
(entdel x)) ss)
)
(princ "\nNo text entities found.")
)
(princ)
)
 
Let me know if this helps. The block called "TREE" must either be inserted into the dwg first or be in the same folder as the dwg.
 
Please hit the Accept as Solution button if my post fully solves your issue or answers your question.

John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 5 of 8

Anonymous
Not applicable

Thanks John,

 

The Lisp routine worked pretty well.  It was great watching all those letter N's switch to the tree block.  The only bad thing about it though is all the blocks come in at the same scale of one.  In the original Microstation dgn their trees were all different sizes.  I looked at the Lisp routine to see if I could somehow change it that the height of the font would somehow affect the insertion scale of the tree block.  So far though no luck.  Do you think this is possible or am I just grasping at straws.  I must admit I haven't fooled with Lisp routines since decades ago but I will keep trying.  

0 Likes
Message 6 of 8

artc2
Autodesk
Autodesk
DGNIMPORT will import DGN Fonts as well if they are available at the time of the import. So, if the fonts you need are in an rsc file and you can get that rsc file and place it in the Acad support path before Acad is started, then the font should import as part of DGNIMPORT. If the font is available during import, it's definition data will be stored in the dwg file, so once the import is complete, the rsc file is not needed for using the resulting dwg file.
Message 7 of 8

john.vellek
Alumni
Alumni
Accepted solution

Hi @Anonymous,

 

I think you could get the text height and then apply a scale factor to the inserted block. I suggest you add a post in the LISP forum to see if you can find some help from the community.

 

I am checking back to see if my post or @artc2 helped you with your problem. Please add a post with your results so other Forum users can benefit.

Please hit the Accept as Solution button if a post or posts fully solved your issue or answered your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 8 of 8

Anonymous
Not applicable

Thanks John and to artc2 for the info.  I'll check on the rsc file and see what we have.  I'll also continue with John's solution for the Lisp routine as a backup.

0 Likes