Nickvnlr Posted April 24 Share Posted April 24 I have this line of code and for the life of me I cannot figure out how to divide by a custom drawing property called "ROW SPACING". ...other stuff (list (list "Total Risers:" (strcat "%<\\AcExpr (Sum(B3:B" (itoa (setq r (+ (length (car x)) 2))) "))/12 \\f \"%lu2%pr0\">%"))) ;;replace 12 with the drawing property "ROW SPACING" ...other stuff How would I do that? Thank you! Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 25 Share Posted April 25 Put the value of ROW SPACING in the variable RS, and run this code: (list (list "Total Risers:" (strcat "%<\\AcExpr (Sum(B3:B" (itoa (setq r (+ (length (car x)) 2))) (strcat "))/" (itoa RS) " \\f \"%lu2%pr0\">%") ) ) ) It should work... Quote Link to comment Share on other sites More sharing options...
Nickvnlr Posted April 25 Author Share Posted April 25 (edited) I put the ROW COUNT into RS Like so: (setq RS (getvar "ROW SPACING")) And then the rest of the suggested code change. That gives me this error: Error: bad argument type <NIL> ; expected <INTEGER> at [itoa] Edited April 25 by Nickvnlr added detail Quote Link to comment Share on other sites More sharing options...
Nickvnlr Posted April 25 Author Share Posted April 25 I fixed it. To retrieve a custom property: (setq si (vla-Get-SummaryInfo (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))) (vla-GetCustomByKey si "ROW SPACING" 'RS) ;;get "ROW SPACING" set to variable RS Since RS is already a string the line will look like this: (list (list "Total Risers:" (strcat "%<\\AcExpr (Sum(B3:B" (itoa (setq r (+ (length (car x)) 2))) "))/" RS "\\f \"%lu2%pr0\">%"))) Quote Link to comment Share on other sites More sharing options...
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.