It doesn't happen often that I need this LISP, but when I have, it has been a life saver.
In today's situation, we are linking a CAD file into a Revit project and the text would not come through. Looking at the CAD file we received, the text is all attributes that have been exploded.
This little gem saved the day. One other thing we end up doing is changing the font for the text in AutoCAD to Zurich LT BT. It looks like Simplex, but plots way better out of Revit.
I don't remember where this lisp came from and it isn't documented, but thank you so much stranger.
;;;
;;; Convert Attribute definitions to text
;;;
(defun c:A2T (/ eset1 blkcnt en enlist vl space)
(setq eset1 (ssget (list (cons 0 "ATTDEF")))
blkcnt 0
)
(if eset1
(while (<= blkcnt (- (sslength eset1) 1))
(setq en (ssname eset1 blkcnt)
enlist (entget en)
space (cdr (assoc 67 enlist))
)
(setq vl (list
(cons 0 "TEXT")
(cons 100 "AcDbEntity")
(cons 100 "AcDbText")
(assoc 7 enlist)
(assoc 8 enlist)
(assoc 10 enlist)
(assoc 40 enlist)
(cond ((assoc 62 enlist))
((cons 62 256))
)
(cons 1 (cdr (assoc 2 enlist)))
(if (= space nil)
(cons 67 0)
(cons 67 space)
)
)
)
(entdel en)
(entmake vl)
(setq blkcnt (1+ blkcnt))
)
)
)
Showing posts with label Dynamic Blocks. Show all posts
Showing posts with label Dynamic Blocks. Show all posts
Wednesday, November 14, 2012
Tuesday, February 21, 2012
Rename all Files in Folders with Sub-Folders
I recently wanted to update version numbers on a ton of AutoCAD Blocks. I copied the old blocks in their current folder structure to a new location and needed to add a version number to the end of each DWG file. This folder structure treed out like a Mighty Oak and the idea of manually changing every file made me nauseous.
You can go old school and open up a DOS prompt by typing CMD in the search box in the start menu. To change every file in a folder quick by browsing to the folder in question and type out...
REN *.dwg *_V2.dwg
I gues you should some DOS commands like CD to change directories. To find out more, just type HELP in the DOS window. DOS will supply a whole list of helpful commands and what they do. Once you figure that part out, the command above works fine,one folder at a time.
To handle a folder structure like I had you'll need a DOS statement with more horse power. This baby below does the trick. Just go to the top folder in your structure and let her rip! It takes about two seconds to rename hundreds of files.
for /f "tokens=* delims= " %a in ('dir /b /ad /s') do rename "%a\*.dwg" "*_V2.dwg"
If you are a copy/paste type of person, you might be annoyed to find the DOS command prompt doesn't seem to want to copy or paste. Click the little icon at the left of the title bar, then click Edit, then Paste. To copy, do the same except pick Mark then highlight want you want to copy out of the DOS editor.
What do you know, that old school DOS really is good for something.
You can go old school and open up a DOS prompt by typing CMD in the search box in the start menu. To change every file in a folder quick by browsing to the folder in question and type out...
REN *.dwg *_V2.dwg
I gues you should some DOS commands like CD to change directories. To find out more, just type HELP in the DOS window. DOS will supply a whole list of helpful commands and what they do. Once you figure that part out, the command above works fine,one folder at a time.
To handle a folder structure like I had you'll need a DOS statement with more horse power. This baby below does the trick. Just go to the top folder in your structure and let her rip! It takes about two seconds to rename hundreds of files.
for /f "tokens=* delims= " %a in ('dir /b /ad /s') do rename "%a\*.dwg" "*_V2.dwg"
If you are a copy/paste type of person, you might be annoyed to find the DOS command prompt doesn't seem to want to copy or paste. Click the little icon at the left of the title bar, then click Edit, then Paste. To copy, do the same except pick Mark then highlight want you want to copy out of the DOS editor.
What do you know, that old school DOS really is good for something.
Friday, July 01, 2011
Heidi Hewett Hosts Facecast About Parametrics
Just another heads up about the next AutoCAD Facecast. The team hopes to get to a point where we have at least one per week!
Heidi Hewett Hosts Facecast About Parametrics
Wednesday, July 6 · 10:00am - 11:00am (Pacific)
The Facecast Tab http://autode.sk/kX9khB
AutoCAD Technical Marketing Manager, Heidi Hewett will review parametrics and take questions for our fans.
If you're unable to make it, the recorded version will be posted on Facebook shortly after.
Monday, June 13, 2011
Apps for AutoCAD
This morning Autodesk released a new tab in the Autodesk Exchange dilalog (in AutoCAD Vanilla only) specifically for apps. This is a link to a virtual apps store not unlike those seen in itunes. The current apps developed have been created by some trusted partners with Autodesk, but are now currently open to anyone with a notion to do so. Some are quite simple and some are more than complicated. Costs range from free to at least one more than $5000 dollars.
This seemingly small addition to the AutoCAD interface not only adds a virtually unlimited amount of resources to the common CAD user, but it also fundamentally changes the way users will look at problems and solutions in AutoCAD and potentially in all other Autodesk software. What ever works in AutoCAD, can certainly be replicated in other software.
The way it is set up, any CAD smarty-pants can set up an app of their own and either give it away on the exchange or earn cash by charging for it. (I just had a vision of a million AutoCAD users seeing dollar sign across the globe, thinking about some lisp or VBA they wrote and use every day.) Add to that all the small companies that already develop plug-ins for AutoCAD, and the larger companies that have companion software. The Apps tab will allow them all to compete in the same market place and it also provides the familiar PayPal interface to handle the financial side.
Not only should every developer of simple lisps to companion products be excited, but mostly Joe AutoCAD user. We just may find a free solution to a long standing problem when we open AutoCAD this morning. For more on this check out the official press release from Autodesk.
This seemingly small addition to the AutoCAD interface not only adds a virtually unlimited amount of resources to the common CAD user, but it also fundamentally changes the way users will look at problems and solutions in AutoCAD and potentially in all other Autodesk software. What ever works in AutoCAD, can certainly be replicated in other software.
The way it is set up, any CAD smarty-pants can set up an app of their own and either give it away on the exchange or earn cash by charging for it. (I just had a vision of a million AutoCAD users seeing dollar sign across the globe, thinking about some lisp or VBA they wrote and use every day.) Add to that all the small companies that already develop plug-ins for AutoCAD, and the larger companies that have companion software. The Apps tab will allow them all to compete in the same market place and it also provides the familiar PayPal interface to handle the financial side.
Not only should every developer of simple lisps to companion products be excited, but mostly Joe AutoCAD user. We just may find a free solution to a long standing problem when we open AutoCAD this morning. For more on this check out the official press release from Autodesk.
Tuesday, October 26, 2010
Close the Block Editor
How lazy can I get? I jacked up my CUI and lost the Block editor contextual tab in the ribbon and rather than fix the problem, I just brought back the classic palettes and used the "bclose" command to close the editor when finished.
I am getting old, time to go fix that right.
I am getting old, time to go fix that right.
Tuesday, January 02, 2007
Thinking Outside the Block
Dynamic blocks have been out there for a while and I think we have all had some idea of what we can use them for. That being said, I think there are many uses for dynamic blocks that don't initially come to mind. I have had a few ideas of my own and some suggested that have really gone far in making the team more efficient. I thought I would share some.
Scheduling
Schedules have repeating rows and columns. If you are not using OLE to bring in Excel files or attribute extraction, using the array and stretch functions in a dynamic block is a great way to add rows and columns on the fly. A word of caution, if you want to use attributes in a dynamic block, the location (in Properties) must be locked to be selected for most anything.
Title Blocks
Seriously, you can have one title block that uses visibility states to morph into all of your standards sizes retaining information through the use of fields. Nest into that an expanding revisions area.
Symbology
North Arrows that rotate the true North, Flipping and stretching section cut symbols. Visibility states can be used to add proper graphic scale to drawings.
Detailing
Give standard details some flexibility by nesting in varying hatch patterns and standard arraying or size changing components. Even standard notes for different situations can be tied to a visibility state.
The point I hope to make is that a door, table or window dynamic block is great, but there are many more options with this powerful new tool if you think outside the block.
Scheduling
Schedules have repeating rows and columns. If you are not using OLE to bring in Excel files or attribute extraction, using the array and stretch functions in a dynamic block is a great way to add rows and columns on the fly. A word of caution, if you want to use attributes in a dynamic block, the location (in Properties) must be locked to be selected for most anything.
Title Blocks
Seriously, you can have one title block that uses visibility states to morph into all of your standards sizes retaining information through the use of fields. Nest into that an expanding revisions area.
Symbology
North Arrows that rotate the true North, Flipping and stretching section cut symbols. Visibility states can be used to add proper graphic scale to drawings.
Detailing
Give standard details some flexibility by nesting in varying hatch patterns and standard arraying or size changing components. Even standard notes for different situations can be tied to a visibility state.
The point I hope to make is that a door, table or window dynamic block is great, but there are many more options with this powerful new tool if you think outside the block.
Subscribe to:
Posts (Atom)


