Lee Mac Posted January 26, 2016 Posted January 26, 2016 I don't understand why append is unnecessary. How is it going to be a part of the list? Because the expression is being passed as an argument to the list function; your append expression will merely return the supplied argument: _$ (append '(1 2 3)) (1 2 3) Quote
ksperopoulos Posted January 26, 2016 Author Posted January 26, 2016 I know you are probably right Lee, but I can't figure out how. It works correctly when I have the append function but I keep getting errors when I try to add the variable laydesc to the list function. Quote
Lee Mac Posted January 26, 2016 Posted January 26, 2016 e.g.: (regapp "AcAecLayerStandard") (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 layname) (cons 6 layltype) (cons 62 laycolor) (cons 70 laystatus) (cons 290 layplot) (cons 370 laylwt) laydesc ) ) Quote
ksperopoulos Posted January 27, 2016 Author Posted January 27, 2016 Lee - that is exactly what I did. Like I mentioned before, this subfunction to create a layer is being used by another main function. Maybe there is something in the rest of the main function's code that is messing it up (although I can't imagine what). In my earlier post, I gave the variables I am passing to this subfunction as well as the whole subfunction itself. Quote
Lee Mac Posted January 27, 2016 Posted January 27, 2016 Lee - that is exactly what I did. Like I mentioned before, this subfunction to create a layer is being used by another main function. Maybe there is something in the rest of the main function's code that is messing it up (although I can't imagine what). In my earlier post, I gave the variables I am passing to this subfunction as well as the whole subfunction itself. Are you relying on global variables, or are you passing the variable values as arguments to your subfunction? If the former, many of the variable names in your earlier post do not match those used in your entmake expression. Quote
ksperopoulos Posted January 27, 2016 Author Posted January 27, 2016 I have localized the variables within my main function and not in the subfunction. I think I am passing the variables to the subfunction as expressions. I am not localizing the variables within the subfunction. (Sorry for the different variable names. I decided to make it a little more descriptive for me. They are the same in both the main and subfunctions though.) Here are some updated parts of my code: Main Function: (defun c:MEPELEV ( / layname layltype laycolor laystate layplot laylweight laydesc ) (setq layname "G-ANNO-ELEV" layltype "Continuous" laycolor 7 laystate 0 layplot 1 laylweight 25 laydesc '(-3 ("AcAecLayerStandard" (1000 . "") (1000 . "Elevation Tags"))) ) ......yadda yadda yadda ) Subfunction: (defun CreateLayer ( ) (regapp "AcAecLayerStandard") (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 layname) (cons 6 layltype) (cons 62 laycolor) (cons 70 laystate) (cons 290 layplot) (cons 370 laylweight) (append laydesc) ) ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.