Group Codes in Numerical Order (http://www.autodesk.com/techpubs/autocad/acad2000/dxf/group_codes_in_numerical_order_dxf_01.htm)
380-389
PlotStyleName type enum (AcDb::PlotStyleNameType). Stored and moved around as a short. Custom non-entity objects may use the full range, but entity classes only use 381-389 DXF group codes in their representation, for the same reason as the Lineweight range above.
(defun c:test ( / )
(entmake (list (cons 0 "LAYER")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 "G-ANNO-SEAL")
(cons 70 0)
(cons 62 7)
(cons 6 "Continuous")
(cons 290 1)
;(cons 370 0)
(cons 389 "As Drawn")
)
)
(princ)
)
How do I set the plot style name via vanilla?
(defun c:test ( / )
(setq tb (entget (tblobjname "LAYER" "0")))
(setq ps (entget (cdr (assoc 390 tb))))
;(print tb)
(print ps)
(princ)
)
(mapcar 'print (entget (namedobjdict)))
What is "cdadr"
do you or somebody have a list of CAR CDR and what they all mean?
((350 . <Entity name: 7ffff0ea870>) (3 . "As drawn") (350 . <Entity name: 7ffff0dcf40>) (3 . "90% Screen") (281 . 1) (280 . 0) (100 . "AcDbDictionary") (330 . <Entity name: 7ffff0ea890>) (102 . "}") (330 . <Entity name: 7ffff0ea890>) (102 . "{ACAD_REACTORS") (5 . "8") (0 . "ACDBDICTIONARYWDFLT") (-1 . <Entity name: 7ffff0ea880>))
((3 . "As drawn") (350 . <Entity name: 7ffff0dcf40>) (3 . "90% Screen") (281 . 1) (280 . 0) (100 . "AcDbDictionary") (330 . <Entity name: 7ffff0ea890>) (102 . "}") (330 . <Entity name: 7ffff0ea890>) (102 . "{ACAD_REACTORS") (5 . "8") (0 . "ACDBDICTIONARYWDFLT") (-1 . <Entity name: 7ffff0ea880>))cd(a)dr = return first element of list from the remaining list above
3 . "As drawn"cda(d)r = skip the first element of the list returned from above
"As drawn"
If you want to use 'vanilla'It matters not to me, vanilla or VL... I am only learning how things work... I am practicing how to access and change DXF codes and manipulate lists and such... I have no objective other than to learn... Visual lisp seems much easier to use but I get stuck on the basics so I focus more on vanilla lisp...
(setq cur_item (car temp_list))
...
(setq tlist (cdr tlist))
c(d)adr = skip the first element of list, return remainder of listQuote((3 . "As drawn") (350 . <Entity name: 7ffff0dcf40>) (3 . "90% Screen") (281 . 1) (280 . 0) (100 . "AcDbDictionary") (330 . <Entity name: 7ffff0ea890>) (102 . "}") (330 . <Entity name: 7ffff0ea890>) (102 . "{ACAD_REACTORS") (5 . "8") (0 . "ACDBDICTIONARYWDFLT") (-1 . <Entity name: 7ffff0ea880>))cd(a)dr = return first element of list from the remaining list aboveQuote3 . "As drawn"cda(d)r = skip the first element of the list returned from aboveQuote"As drawn"
Essentially, read the a's & d's from right to left.was all I needed to understand then the example to confirm it... amazing... thank you.
(car (nth index1 ....)).I have seen examples using "nth" and I have read about it but I have never used it, I haven't found a need yet but maybe now I have.
Lee, you have an excellent way of explaining things...QuoteEssentially, read the a's & d's from right to left.was all I needed to understand then the example to confirm it... amazing... thank you.
Are you telling me that I can only read "ACAD_PLOTSTYLENAME" dictionary items with vanilla lisp and will need to use visual lisp to modify it? If this is so, then I can see I need to move past this.If you want to change the plot style of a layer to a plot style that is already in use in the drawing then that would be doable (but not very easy) in 'vanilla'. Adding a new plot style using 'vanilla' would very hard and may even be impossible. I have never tried it.
... I am only learning how things work... I am practicing how to access and change DXF codes and manipulate lists and such...If your goal is to learn more about (entmake) and (entmod) I would suggest starting with other entities and properties. Changing the color of graphical entities is a better starting point.
What is a collapsing lisp procedure, first time I have heard of this...
I am not sure what you are showing me in your example.
If you want to change the plot style of a layer to a plot style that is already in use in the drawing then that would be doable (but not very easy) in 'vanilla'. Adding a new plot style using 'vanilla' would very hard and may even be impossible. I have never tried it.Thanks Roy...
"Collapsing lisT" (emphasis on the T). Sometimes I have to process a *very* large list in a way that I have to find something later in the list. I could use (nth ...) to iterate over the entire list, but that can make for a very long search eg. 1st item, search against items 2 through n; 2nd item, search through items 1 and 3 through n; and so on. Or I can try to manage a secondary index of where to start searching; that gets even worse if I have to start removing that matching element from the list. Instead, on each pass I use (car ...) to get the first item in the list and (setq tlist (cdr tlist)) to set the working list as the remainder. Since the list is shrinking (collapsing) with every cycle, each pass needs to process fewer and fewer items.Thanks dgorsman for explaining to me your example. This helps me very much... and I find the NTH function very handy now I understand the CAR, CDR concatenations.
I have to revise this opinion. Working with plot styles in 'vanilla' is possible and even adding a new style is not that hard. The code below works on BricsCAD V13.2.10 (I don't use 'the other product').Are you telling me that I can only read "ACAD_PLOTSTYLENAME" dictionary items with vanilla lisp and will need to use visual lisp to modify it? If this is so, then I can see I need to move past this.If you want to change the plot style of a layer to a plot style that is already in use in the drawing then that would be doable (but not very easy) in 'vanilla'. Adding a new plot style using 'vanilla' would very hard and may even be impossible. I have never tried it.