Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing Wall styles

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
212 Views, 6 Replies

Importing Wall styles

In ADT 2.0 is it possible to import several wall
styles from a template with a lisp routine?  I am trying to create a
routine to redefine existing wall styles since a lot of our old drawings were
using messed up wall styles.
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

Ender,

 

The only way to import specific Aec Objects is via
DBX .  Or you can save your default template file as a drawing. I have one
called AecStyleFile.dwg. 

Then add this line to your Acad2000doc.lsp
file

 

(if (not (tblsearch (namedobjdict)
"AEC_WALL_STYLES")

    (progn

    (command "_.insert"
"YourFileName")

    (command "_.explode" (entlast)
"")

    )

)

 

let me know how it goes.

 


--

-------------------------------------------------------------------------
Rob
Starz
Stardsign cad solutions
iC - AEC Information Center

href="http://www.stardsign.com/aecic.html">www.stardsign.com/aecic.html

LayerX
beta testers needed...
href="http://www.stardsign.com/beta_programs.htm">www.stardsign.com/beta_programs.htm


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

In ADT 2.0 is it possible to import several wall
styles from a template with a lisp routine?  I am trying to create a
routine to redefine existing wall styles since a lot of our old drawings were
using messed up wall styles.
Message 3 of 7
jbuzbee
in reply to: Anonymous

Yes it is, however, it requires some pretty advanced code. How in-depth is your knowledge of the ActiveX extensions exposed in AutoLISP for 2000+? Here is a road map: 1. You will first need to create a routine that access the ObjectDBX Interface to "open" the "template drawing". 2. Access the dictionary collection of the opened DBX document and look for "AEC_WALL_STYLES". 3. At this point you can search for individual "styles" as defined in the dictionary. 4. Once you have found the entity of the style you want to "import" you need to use the "vla-copy" method to copy the dictionary from the DBX document to the active document. 5. VERY IMPORTANT: at this point you need to release everything or your program will crash AutoCAD. I'm not trying to scare you away from attempting this, just let you know ahead of time what your in for. You might want to check with Peter Funk over at the ADT customization NG for a VBA equivalent - if it even can be done in VBA. James Buzbee
Message 4 of 7
Anonymous
in reply to: Anonymous

This creates wall styles right?  I'm trying to
redefine existing wall styles.  Your routine won't redefine
existing wall styles, will it?

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ender,

 

The only way to import specific Aec Objects is
via DBX .  Or you can save your default template file as a drawing. I
have one called AecStyleFile.dwg. 

Then add this line to your Acad2000doc.lsp
file

 

(if (not (tblsearch (namedobjdict)
"AEC_WALL_STYLES")

    (progn

    (command "_.insert"
"YourFileName")

    (command "_.explode" (entlast)
"")

    )

)

 

let me know how it goes.

 


--

-------------------------------------------------------------------------
Rob
Starz
Stardsign cad solutions
iC - AEC Information Center

href="http://www.stardsign.com/aecic.html">www.stardsign.com/aecic.html

LayerX
beta testers needed...
href="http://www.stardsign.com/beta_programs.htm">www.stardsign.com/beta_programs.htm


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

In ADT 2.0 is it possible to import several
wall styles from a template with a lisp routine?  I am trying to create
a routine to redefine existing wall styles since a lot of our old drawings
were using messed up wall
styles.
Message 5 of 7
Anonymous
in reply to: Anonymous

didn't read it fully.  No this will not update
your styles.

 

read Jims post.  DBX is lots of
fun.


--

-------------------------------------------------------------------------
Rob
Starz
Stardsign cad solutions
iC - AEC Information Center

href="http://www.stardsign.com/aecic.html">www.stardsign.com/aecic.html

LayerX
beta testers needed...
href="http://www.stardsign.com/beta_programs.htm">www.stardsign.com/beta_programs.htm


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

This creates wall styles right?  I'm trying
to redefine existing wall styles.  Your routine won't redefine
existing wall styles, will it?

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ender,

 

The only way to import specific Aec Objects is
via DBX .  Or you can save your default template file as a drawing. I
have one called AecStyleFile.dwg. 

Then add this line to your Acad2000doc.lsp
file

 

(if (not (tblsearch (namedobjdict)
"AEC_WALL_STYLES")

    (progn

    (command "_.insert"
"YourFileName")

    (command "_.explode"
(entlast) "")

    )

)

 

let me know how it goes.

 


--

-------------------------------------------------------------------------
Rob
Starz
Stardsign cad solutions
iC - AEC Information Center

href="http://www.stardsign.com/aecic.html">www.stardsign.com/aecic.html

LayerX
beta testers needed...
href="http://www.stardsign.com/beta_programs.htm">www.stardsign.com/beta_programs.htm


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

In ADT 2.0 is it possible to import several
wall styles from a template with a lisp routine?  I am trying to
create a routine to redefine existing wall styles since a lot of our old
drawings were using messed up wall
styles.
Message 6 of 7
Anonymous
in reply to: Anonymous

Ahhh.  No my knowledge do be limited.  I
think maybe I can use the command line version to actually edit the existing
wall styles.  Only thing is I won't be able to change the hatches. 
Here's the simple code I have.  It only allows one component, but I believe
I can add extra if I will need it.  Right now I don't.  My main
problem was with component priorities.  So this updates those.

 

 

(defun definewall (W_NAME W_END_1 W_END_2
W_COMP_1_N W_COMP_1_P)
  (COMMAND "-AECWALLSTYLE"   
"EDIT"      W_NAME   
"ENDCAP"
    W_END_1    
W_END_2    "COMPONENT" "E"   
"1"
    "NAME"      W_COMP_1_N 
"PRIORITY"  W_COMP_1_P  ""
   
""        ""   
""
   )
)

 

I will use it like:

(DEFINEWALL "NEW WALL" "STANDARD" "STANDARD"
"GYP" "1201")

 

 


 

Thanks for all your help guys.  I might try
the more advanced languages one day, but not now.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Yes
it is, however, it requires some pretty advanced code. How in-depth is your
knowledge of the ActiveX extensions exposed in AutoLISP for 2000+? Here is a
road map: 1. You will first need to create a routine that access the ObjectDBX
Interface to "open" the "template drawing". 2. Access the dictionary
collection of the opened DBX document and look for "AEC_WALL_STYLES". 3. At
this point you can search for individual "styles" as defined in the
dictionary. 4. Once you have found the entity of the style you want to
"import" you need to use the "vla-copy" method to copy the dictionary from the
DBX document to the active document. 5. VERY IMPORTANT: at this point you need
to release everything or your program will crash AutoCAD. I'm not trying to
scare you away from attempting this, just let you know ahead of time what your
in for. You might want to check with Peter Funk over at the ADT customization
NG for a VBA equivalent - if it even can be done in VBA. James
Buzbee
Message 7 of 7
Anonymous
in reply to: Anonymous

Jim,

 

I have been DBX'ing in styles but I never checked
to see if Existing styles were updated...so I tried it.  From what I have
gotten it is not updating existing styles.

 

Are you getting differrent results?


--

-------------------------------------------------------------------------
Rob
Starz
Stardsign cad solutions
iC - AEC Information Center

href="http://www.stardsign.com/aecic.html">www.stardsign.com/aecic.html

LayerX
beta testers needed...
href="http://www.stardsign.com/beta_programs.htm">www.stardsign.com/beta_programs.htm

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

Post to forums  

Autodesk Design & Make Report

”Boost