[i][color=#990099];; Inside these bracket we list all the[/color][/i]
[i][color=#990099];; arguments needed for the function to[/color][/i]
[i][color=#990099];; work (before the forward slash), in this[/color][/i]
[i][color=#990099];; case none, and all the local variables[/color][/i]
[i][color=#990099];; i.e. symbols which have a value bound to[/color][/i]
[i][color=#990099];; them, which are used in the function.[/color][/i]
[i][color=#990099];; These variables will be set to nil when[/color][/i]
[i][color=#990099];; when the function is invoked and when the[/color][/i]
[i][color=#990099];; function completes.[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [i][color=#990099];; We must allow for the user not selecting[/color][/i]
[i][color=#990099];; anything.[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [i][color=#990099];; Both of the following conditions must[/color][/i]
[i][color=#990099];; return True for the IF statement to proceed.[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ent [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entsel[/color][/b] [b][color=#a52a2a]"\nSelect Text Object: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
[i][color=#990099];; If the user picks something, entsel will return a[/color][/i]
[i][color=#990099];; list with two elements. The first element will be[/color][/i]
[i][color=#990099];; the entity name of the entity that was picked, and[/color][/i]
[i][color=#990099];; the second element will be the actual point that was[/color][/i]
[i][color=#990099];; picked, i.e. (3.4 5.2 0.0). We are only interested in[/color][/i]
[i][color=#990099];; the entity name, so we use 'car' to get the first element[/color][/i]
[i][color=#990099];; of the list, and then use 'setq' to bound this entity[/color][/i]
[i][color=#990099];; name to a variable, so that we can reference it later.[/color][/i]
[i][color=#990099];; Note that, if the user doesn't pick anything, entsel[/color][/i]
[i][color=#990099];; will return nil, and so (car (entsel)) will also return[/color][/i]
[i][color=#990099];; nil, and our IF statement will not be fullfilled.[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]40[/color][/b] [b][color=#009999]2.0[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; A dotted pair '(40 . 2.0)[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]40[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; For the DXF group 40 entry in the list[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; The data list that is being operated on.[/color][/i]
[i][color=#990099];; This is the business end of the function. Here we are using the[/color][/i]
[i][color=#990099];; 'subst' function to substitute '(40 . 2.0) for the entry that[/color][/i]
[i][color=#990099];; starts with 40 in the DXF data list.[/color][/i]
[i][color=#990099];; The DXF code 40 represents the Text Height of the text, and,[/color][/i]
[i][color=#990099];; once we have made the substitution, we must update the entity[/color][/i]
[i][color=#990099];; using the 'entmod' function.[/color][/i]
[b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#a52a2a]"\n** Object is Not Text **"[/color][/b][b][color=RED])[/color][/b]
[i][color=#990099];; This is the ELSE statement for the IF function, so here we[/color][/i]
[i][color=#990099];; are alerting the user that they have not picked a text object.[/color][/i]
[b][color=RED])[/color][/b] [i][color=#990099]; End IF[/color][/i]