DavidGraham Posted September 19, 2018 Share Posted September 19, 2018 I'm using a LISP routine to get some data from a drawing. I'm then writing the data to an Excel spreadsheet. One of the fields should contain 'delta' with delta being the Greek letter in the shape of a triangle. I found some code that will do this but it doesn't appear to work - the cell contains '\U+0647' rather than the required symbol. The example below is for '?', once I get that to work I will change it for Delta - '\U+0184'. (setq delta (MT:Conv:Unichar->Char "\\U+0647")) -- returns --> "?" (defun MT:Conv:Unichar->Char (%unichar% / *ret*) (command "_.TEXT" '(0 0) "0.3" "0" %unichar%) (setq *ret* (cdr (assoc 1 (entget (entlast))))) (entdel (entlast)) *ret* ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 20, 2018 Share Posted September 20, 2018 Hmm hold in excel pick a cell hold the Alt key down and type 0174 a ® should appear. Did you google excel and extended character set ? May give some clues of how to replicate keyboard typing with a text string. If you use mtext or text and do hold Alt down then type 0178 you will get squared 2. (setq obj (vlax-ename->vla-object (car (entsel "\nPick ")))) (setq ans (vla-get-textstring obj)) Try passing ans to a cell. I just copied from Autocad a ® to clipboard then pasted in excel and ® appeared. Quote Link to comment Share on other sites More sharing options...
DavidGraham Posted September 20, 2018 Author Share Posted September 20, 2018 Thanks, I found that typing =UNICHAR(916) into an Ecvel cell gave the Delta symbol, therefore using the following LISP code it gave a delta symbol in cell B2. (setq cel (vlax-get-property sht 'Range "B2")) (vlax-put cel 'Value "=UNICHAR(916)") 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.