Jump to content

Leaderboard

  1. Lee Mac

    Lee Mac

    Trusted Members


    • Points

      25

    • Content Count

      20,555


  2. BIGAL

    BIGAL

    Trusted Members


    • Points

      22

    • Content Count

      14,079


  3. steven-g

    steven-g

    Trusted Members


    • Points

      18

    • Content Count

      2,661


  4. pkenewell

    pkenewell

    Community Members


    • Points

      10

    • Content Count

      228



Popular Content

Showing content with the highest reputation since 01/27/2021 in all areas

  1. 5 points
    Totally inappropriate response Jamin. Good luck with your next CAD problem. The members who have posted in this thread include 2 forum moderators and collectively have a total of about 65,000 posts.
  2. 3 points
    Deleting all write-enabled dimensions (i.e. those residing on unlocked layers) from a drawing is relatively straightforward and can be achieved by iterating over the drawing database and deleting all objects whose objectname property matches "AcDb*Dimension*", as the following code demonstrates: (defun c:deldim ( ) (vlax-for blk (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (= :vlax-false (vla-get-isxref blk)) (vlax-for obj blk (if (and (wcmatch (vla-get-objectname obj) "AcDb*Dimension*") (vlax-write-enabled-p obj)) (vla-delete obj) ) ) ) ) (princ) ) (vl-load-com) (princ) The above will remove all dimensions from all layouts & block definitions. However, deleting MText containing specific words isn't quite so easy, as the MText content could potentially be interspersed with MText formatting codes, which would need to be removed prior to testing whether the content contains one of the target words.
  3. 2 points
    Nice .. FWIW if you create the circle like so it will retain all by object properties too: (defun c:el2cir (/ cen cnt en ent maj mad) (if (setq ss (ssget '((0 . "ELLIPSE")))) (repeat (setq cnt (sslength ss)) (setq ent (entget (setq en (ssname ss (setq cnt (1- cnt)))) '("*")) cen (cdr (assoc 10 ent)) maj (cdr (assoc 11 ent)) mad (distance '(0.0 0.0 0.0) maj) ) (if (= (cdr (assoc 40 ent)) 1.0) ;; (progn (command "._circle" "_non" cen mad) (entdel en)) (and (entmake (append '((0 . "CIRCLE")) (vl-remove-if '(lambda (x) (vl-position (car x) '(-1 0 100 330 5 11 40 41 42))) ent) (list (cons 40 mad)) ) ) (entdel en) ) ) ) ) (princ) )
  4. 2 points
    Here is a simple bit of code that will do it. (defun c:UnmirrorBlock (/ ss en xscl yscl zscl) (if (setq ss (ssget '((0 . "INSERT")))) (progn (repeat (setq cnt (sslength ss)) (setq en (entget (ssname ss (setq cnt (1- cnt)))) xscl (abs (cdr (assoc 41 en))) yscl (abs (cdr (assoc 42 en))) zscl (abs (cdr (assoc 43 en))) en (subst (cons 41 xscl) (assoc 41 en) en) en (subst (cons 42 yscl) (assoc 42 en) en) en (subst (cons 43 zscl) (assoc 43 en) en) en (subst (cons 50 0.0) (assoc 50 en) en) ) (entmod en) ) ) ) )
  5. 2 points
    The reason is because it tries to run the other commands before you finish the "pline" command. You need to delay the operation of the rest of the routine until it is finished. It does not do this for you with only 1 PAUSE option. Try This - note the "cmdactive" loop to pause the "pline" command until you are finished drawing the polyline (see my comments for other improvements): (Defun C:TestPl (/ plccLayer oecho oplwid ss); Localize your variables (setq plccLayer (getvar "clayer") oplwid (getvar "plinewid") oecho (getvar "cmdecho")) (setvar "plinewid" 0.015) ;; Don't use command to set system variables. ;; You want CMDECHO set to 1 here so you can see pline prompts. ;; FYI - the "dot" before the command ensures that the true command is used (not redefined), ;; the "underscore" will translate command names and options for international versions. (COMMAND "._-LAYER" "_M" "FIBER" "_C" "130" "" "_L" "FENCELINE1" "" "" "._PLINE" ) ;; This loops the pause until the command is over. (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) ;; reset system variable back to original values. (setvar "clayer" plccLayer) (setvar "PLINEWID" oplwid) ;; Set cmdecho here to 0 to not see the change command. (setvar "CMDECHO" 0) (setq ss (ssget "L")) (command "._Change" ss "" "_P" "_S" 0.25 "") ;; Reset cmdecho back to original value. (setvar "cmdecho" oecho) (princ) )
  6. 2 points
    I don't work in feet god bless metric makes life so much easier. Anyway my take on metres to feet. Tried to get distof to work. ; tol 1/16" (setq a 3.25 str "") (setq ar (/ a 0.3048)) (setq ai (fix (/ a 0.3048))) (setq b (- ar ai)) (setq str (strcat (rtos ai 2 0) "'")) (IF (> b (/ 0.0625 12.0)) (progn (setq c (* 12.0 b)) (setq inch (fix c)) (setq str (strcat str (rtos inch 2 0) "\"")) (setq frac (* (- c inch) 16.0)) (if (/= (fix frac) 0.0) (setq str (strcat str (rtos frac 2 0) "/16" )) ) ) ) (princ str)
  7. 2 points
    Since when does the draftsman decide what is going to be included in a drawing? If the company is obligated to provide a client with a drawing then they must do so or they risk losing the client's business. Ask the draftswoman to name the specific tools and techniques she is "unwilling" to share. Then remind her the company is not obligated to retain her as an employee.
  8. 2 points
    Sounds like you need a new draftsman. Can they explain exactly what the concern is about? Since what I draw on company time belongs to the company, I am required to send what my bosses ask me to send.
  9. 2 points
    Extra tools are usually lisp routines, which are not transferred with the drawing. Techniques are the way that the end result is produced and are within the draftsman. If you have any complex linetypes, then the second user would have to have the shape files to see the shapes, and the font file if it was a non standard one. You could DXFOUT with entities only.
  10. 2 points
    Yeah, okay. Sorry you missed all of the posts that were actual solutions and not guesses. The OP obviously didn't acknowledge them but they are solutions. The reason why people point out the age of a post is because it's forum etiquette to not dig up old threads. Your mission is honorable albeit a bit misguided. Someone with such simple issues is not going to be digging through threads that are many years old. Your more likely to help someone that has posted recently than someone who might stumble upon decades old threads. Plus, you get the satisfaction of knowing that you actually helped someone. Now you can make an informed decision the next time you want to respond to a thread that's a decade old.
  11. 2 points
    Hi ish check this link https://esurveying.net/plan-and-profile-drawing-software/cad-layout-automation
  12. 2 points
    Not a good practice to get into blocking a whole dwg. I have had dwg's submitted and took a while to find but had a complete other dwg saved as a block but not used so bloated the dwg. If you save a dwg you can Insert it into another dwg this would be a better way are you trying to do some form of I want these objects in a new dwg, is not a DWT template dwg for that task ?
  13. 2 points
    Here's one possible way: (defun c:toglay ( ) (vlax-for lay (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (foreach prp '(lock layeron freeze) (vl-catch-all-apply 'vlax-put (list lay prp (~ (vlax-get lay prp)))) ) ) (princ) ) (vl-load-com) (princ)
  14. 2 points
    @Steven P It's not required to set any system variable with this routine and I already commented them out if you did not notice that, although it is strongly recommended to have error handle to reset the system variable(s) back once any error take a place.
  15. 2 points
    Bricscad has 30 day trial and other cad software has the same, like Nanocad, Drafsight used to be free but is very inexpensive.
  16. 2 points
    Please post the code you have so far and the reference equations you are using for calculating the sag. The equations at this site seem to be straightforward although LISP make make them ugly. Start by calculating x1 and x2 then go on to sag. How do you determine the 1% sag limit with two poles each of different heights and potentially mounted at different elevations?
  17. 2 points
    If you are a student, you can get an educational version free of charge, good for one year. You must provide proof that you are a student. See this page.
  18. 2 points
    Rather than debug yours this does what you want just compare, the only difference is it makes a PDF directory rather than delete files. As you can see used since 2014 This version uses Ghostscript and joins all the pdf's into 1 pdf as well as individuals. Rather than delete I would delete the pdf files if exist can use (command "shell" "Del dwgpre\*.pdf") mergepdfs.lsp ;Plots layouts by range ; By Alan H Feb 2014 (defun AH:pltlays ( / val1 val2 plotnames dwgname lendwg pdfname lay numlay numend dwgpre) (SETVAR "PDMODE" 0) (setvar "plottransparencyoverride" 2) (setvar "fillmode" 1) (setvar "textfill" 1) (setq plotnames '()) ; check that pdf directory exists (setq dwgpre (strcat (getvar "dwgprefix") "\pdf")) (if (= (vl-file-directory-p dwgpre) nil) (vl-mkdir dwgpre) ) (SETQ LAYOUTS (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))) (SETQ COUNT (- (VLA-GET-COUNT LAYOUTS) 1)) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq vals (AH:getvalsm (list "Enter plot range" "Enter start tab number" 6 4 "1" "Enter end tab number" 6 4 (RTOS COUNT 2 0)))) (setq numlay (atoi (nth 0 vals))) (setq numend (atoi (nth 1 vals))) (setq len (+ (- numend numlay) 1)) (setq dwgname (GETVAR "dwgname")) (setq lendwg (strlen dwgname)) (setq dwgname (substr dwgname 1 (- lendwg 4))) (repeat len (vlax-for lay LAYOUTS (if (= numlay (vla-get-taborder lay)) (setvar "ctab" (vla-get-name lay)) ) ; if (setq pdfname (strcat dwgpre "\\" dwgname "-" (getvar "ctab") ".pdf" )) ) ; for (setvar "textfill" 1) (setvar "fillmode" 1) (setvar "PLOTTRANSPARENCYOVERRIDE" 2) (COMMAND "-PLOT" "Y" "" "dwg to Pdf" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Acad.ctb" "Y" "n" "n" "n" pdfName "N" "y" ) (setq numlay (+ numlay 1)) (setq plotnames (cons pdfname plotnames)) ) ; end repeat (setq trgfile (strcat (getvar "dwgprefix") "pdf\\" dwgname "-D" (nth 0 vals) "-D" (nth 1 vals) ".pdf")) (setq plotnames (reverse plotnames)) (IF (= (length plotnames) 1) (princ) (progn (if (not combinepdf)(load "mergepdfs")) (combinepdf gsExe plotnames trgFile ) ) ) ) ; defun (AH:pltlays) (princ) Multi GETVALS.lsp
  19. 2 points
    Substr Returns the substring of string , starting at character start and extending for length characters. $(substr, string, start [, length]) Characters in the string are numbered from 1. If length is omitted, it returns the entire remaining length of the string. $(substr,$(getvar,"dwgname"),1,10)
  20. 2 points
    The value of 0.924999...955 is a consequence of the accuracy problems associated with the double-precision floating-point format used to store real numbers in computer memory - this is described in more detail here, here, and here. Your code demonstrates one possible way to cater for this, however, note that your method would yield undesirable results for measurements such as 0.9249: _$ (rtos (distof (rtos 0.9249 2 3) 2) 2 2) "0.93" _$ (rtos 0.9249 2 2) "0.92" As such, a safer way to account for the rounding of doubles would be to add a small tolerance to the original value prior to rounding, e.g.: _$ (rtos (+ 1e-8 0.924999999999955) 2 2) "0.93" _$ (rtos (+ 1e-8 0.9249) 2 2) "0.92" However, note that retrieving the dimension measurement value and rounding to a given number of decimal places may still not yield a string which matches that displayed by the dimension, as a result of dimension style configuration - to obtain the value displayed by the dimension, you can obtain the MText content found within the dimension block, e.g.: ;; Get Dimension String - Lee Mac ;; Returns the displayed content of a dimension (defun LM:getdimstring ( ent / enx rtn ) (if (and (setq enx (entget ent)) (wcmatch (cdr (assoc 0 enx)) "*DIMENSION") (setq ent (tblobjname "block" (cdr (assoc 2 enx)))) (setq ent (entnext ent) enx (entget ent) ) ) (while (and ent (null rtn)) (if (= "MTEXT" (cdr (assoc 0 enx))) (setq rtn (cdr (assoc 1 enx))) ) (setq ent (entnext ent) enx (entget ent) ) ) ) rtn )
  21. 2 points
    Here's another way to write it: (defun c:dimover ( / i s ) (if (setq s (ssget "_X" '((0 . "*DIMENSION")(1 . "*?*")(1 . "~*<>*")))) (repeat (setq i (sslength s)) (entmod (append (entget (ssname s (setq i (1- i)))) '((62 . 1)))) ) ) (princ) )
  22. 2 points
    If you supply a partial DXF list to the entmod function, only those groups included in the list will be modified (provided that there are sufficient groups present to identify the entity in the drawing database), as such, I believe you would need to delete & recreate the entity with the relevant groups removed, e.g.: (defun c:test ( / ent enx ) (if (and (setq ent (car (entsel))) (= "MTEXT" (cdr (assoc 0 (setq enx (entget ent))))) ) (if (entmake (vl-remove-if '(lambda ( x ) (= 3 (car x))) enx)) (entdel ent) (princ "\nUnable to create modified entity.") ) (princ "\nNothing selected or object wasn't MText.") ) (princ) )
  23. 2 points
    I didn't notice the flip action behaving that way, it could be a version issue. neat block, and really neat method, looks like I have to read up on this, and practice, I can see this in my future.
  24. 2 points
    Members who use BricsCAD as their main CAD product can now add the Lite, Pro, BIM or Mechanical versions to their profile. To do so, go to your profile page, click on Edit Profile, look for My Software and select your BricsCAD product from the drop-down list at Main CAD Product.
  25. 2 points
    Sounds like @steven-g will have sorted you out. Alternately you can hold down the Ctrl button, and you should then be able to move it, even if it is locked.
  26. 2 points
    If you look at the complex linetypes with letters, supplied in your posted acad.lin (Hot Water Supply and Gas Line) you will see the U factor has been added already. Be warned that all text fonts are not the same sized characters, so when you make a text feature in a complex linetype, your x, y and s factors might need to be tweaked for different fonts.
  27. 2 points
    Hello If you are having trouble running StripMtext in AutoCAD 2021, please verify you have installed the AutoCAD 2021.1 update that was released in August 2020. This update fixes a bug in AutoLisp that broke the Vbscript RegEx object which StripMtext (and similar routines) use to find and remove formatting codes in a mtext. if after verifying you still are having trouble, then let me know and I’ll look into it. HTH, Steve Doman
  28. 2 points
    (command "_.-layer" "_lw" "default" "*" "")
  29. 2 points
    Because the verticals run on top of the vanilla Autocad there is no need to install the vanilla Autocad. For instance with Civl3D, it runs on top of Map3D witch runs on top of Vanilla Autocad. So with one install of Civil3D you are installing 3 products so to speak.
  30. 1 point
    Oh thanks! I was trying to solve the problem only by setting the variables and I didn't think about the Layer State! Thanks you solved the problem!
  31. 1 point
  32. 1 point
    Back in the early 70's I used to draw radio controlled scale model airplane plans extrapolated from 3 view drawings of airplanes that had overall dimensions. There used to be a series of books one could buy at the local hobby shop with different eras of military or civilian planes. I don't remember anything about the publications other than they were about letter size and the drawings in them were very well detailed and precise to the scale. There was no internal details nor any drawings other than the external three views. The plan view was usually a half & half top & bottom view. I'd transfer the outline at scale to velum and then add in the parts I'd need to hold the engine, tank, servos pushrods and the like. The design was with balsawood construction in mind. My most memorable one I did was a P-47 Thunderbolt with the "razorback" cockpit configuration, my all time favorite WW II fighter. It was one of only two I ever built from my own plans and the most successful one in that it actually flew very well. Damn, that was almost 50 years ago now. I remember marveling at how easy the center of gravity was to get right. Very little weight was needed to balance it out of being nose heavy.
  33. 1 point
    i noticed the LSP is designed to insert the size in meters but then convert meters to feet, correct? My gut tells me this is the cause of the anomaly. It looks like the correct conversion factor would be: 1 meter = 3.28083989501312 foot So your meter to feet number in "precision" in your LSP shows .32808333 but it looks like this should be .328083989501312 Other than this, It is possible to have an error factor in Autocad depending on what drawing units you are using in your DWG. But I'm sure there are others more versed in this than I that can explain it better. I am not an expert as I've used imperial for the last 17 years lol. SO if you are using imperial inches UNITS in your dwg file, the LISP will add the dimension in meters - right away that number will be wrong. Then that number gets reconverted back to feet by the LSP but that original metric multiplier would still be incorrect (in this example, at least). So the feet text would also be slightly off in theory. Maybe there is an error with inches in a metric DWG but from what I recall the error is more associated with metric objects in an Imperial DWG because of how autocad does the conversion.
  34. 1 point
    I came across this link https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/AutoCAD-Core/files/GUID-5070C6C7-EAEF-45F0-ABB8-F894E585C54D-htm.html I will paste the relevant part here: The XREFOVERRIDE system variable affects display and plotting, and works in conjunction with the VISRETAIN system variable. Consider these scenarios: If you want the xref layers to retain their layer settings, it is recommended to set VISRETAIN and XREFOVERRIDE system variables to 0. If you want the xref layers to retain the overrides you made in the current (host) drawing, it is recommended to set VISRETAIN to 1. This assumes that the visual properties on the external reference objects are set to ByLayer. When XREFOVERRIDE is set to 1, objects on xref layers are treated as if their properties are set to ByLayer. When XREFOVERRIDE is set to 0, objects on xref layers honor their object property assignments. The VISRETAINMODE system variable provides you with more options on how you want to control and manage the xref layer property overrides in your current (host) drawing when you have set VISRETAIN to 1. By default, the VISRETAINMODE, a bitcoded system variable, is set to 0. To specify more than one layer properties that you want to automatically sync, enter the sum of their values. You can choose any combination for the xref layer properties that you want to reload from the referenced layer settings even when you have set VISRETAIN to 1. But, if you do not want to synchronize xref layer properties, you should keep the default value for VISRETAINMODE. Legacy Drawings and Xref Layer Property Overrides Settings If you have a legacy drawing, which you opened in AutoCAD 2018.1 or later versions, any changes to the referenced layer property will not get updated automatically in the current drawing regardless of what value you have set for your VISRETAINMODE sysvar (changed the default value). This behavior ensures that anytime you open a drawing that is authored in an earlier version of AutoCAD 2018.1, it maintains the visual fidelity between AutoCAD 2018.1 and previous AutoCAD releases and there is no change in behavior. To make VISRETAINMODE take effect for legacy drawings, you need to save the current drawing in AutoCAD 2018.1 and reload the xref drawing to see the changes.
  35. 1 point
    can't remember where I got this from, all credits should go there of course. This should delete duplicate text objects (text on top of identical text) but will leave alone if the text is at different coordinates. (defun c:txtdeldup( / ss ssdup ct len e eb pt lay ang sty hgt str obj obj_list) (princ "\nSelect text objects.") ;Select objects and filter all but block insert objects. (setq ss (ssget (list (cons 0 "TEXT")))) (if ss ;If any valid objects were selected. (progn (princ "\nBuilding list of objects.") (setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete (setq len (sslength ss)) ;Find out how many objects were selected. (setq ct 0) (while (< ct len) ;Loop through selected objects (setq e (ssname ss ct)) ;Get an object name (setq eb (entget e)) ;Get the entity list from the object name (setq ct (+ ct 1)) ;Increment index into selection set (setq pt (cdr (assoc 10 eb))) ;Access object's coordinate (setq lay (cdr (assoc 8 eb))) ;Access object's layer (setq ang (cdr (assoc 50 eb))) ;Access object's rotation angle (setq sty (cdr (assoc 7 eb))) ;Access object's text style (setq hgt (cdr (assoc 40 eb))) ;Access object's text height (setq str (cdr (assoc 1 eb))) ;Access object's text string ;Make list of object properties ;(setq obj (list pt lay ang sty hgt str)) (setq obj (list pt str)) (if (not (member obj obj_list)) ;If these properties are not already in list (setq obj_list (cons obj obj_list)) ;Add them to the list (ssadd e ssdup) ;Else add object to selection set to delete ) ;End if ) ;End of while loop (if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete (progn (princ "\nDeleting duplicate objects.") (setq len (sslength ssdup)) ;Find out how many many objects to delete. (setq ct 0) (while (< ct len) ;Loop through objects and delete. (setq e (ssname ssdup ct)) ;Get object name (setq ct (+ ct 1)) ;Increment index into selection set (entdel e) ;Delete duplicate object ) ;End of while loop ;Print the number of objects deleted to command line (princ (strcat "\nDeleted " (itoa len) " duplicate objects." )) ) ;End progn (princ "\nNo duplicates found.") ;Else no there were no duplicates to delete. ) ;End if ) ;End progn (princ "\nNo text objects selected.") ;Else there were no valid objects selected ) ;End if (princ) )
  36. 1 point
    I think that drawing an Xline with Polar Tracking is tricky until you know what you are looking out for. Drawing an ordinary line would be much easier. First of all, set up Polar Tracking by right clicking on the POLAR tab at the bottom of the screen and choose Settings. In the Polar Angle measurement, I use Relative to last segment. You can enter any Increment angle, but 45° is enough for me. Polar Tracking displays temporary alignment paths defined by the polar angles you specify. As you move the cursor, when you get to a specified angle, a small cross appears at the cursor and the alignment path extends beyond the cursor. When you see this alignment path, you can pick the length of your line or enter it at the keyboard. Drawing a Xline is more difficult because the Xline is on top of the alignment path and you can only see the cross at the cursor. Practice makes perfect, but when you can use it, Polar Tracking is most useful.
  37. 1 point
    Right-Click the Hatch, then select Generate Boundary. Or Hatch Edit, then select Recreate Boundary button.
  38. 1 point
    Another osmode 517 Line pick point on circle "near" etc pick point "CEN" Enter RO L enter end 90 You could make it a pretty simple defun joining all steps.
  39. 1 point
    Civil 3D has a tool for that but AutoCAD does not. https://civilimmersion.typepad.com/civil_immersion/2020/09/creating-higher-value-geometry-using-the-map-cleanup-tools-in-civil-3d.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+CivilImmersion+(Civil+Immersion)
  40. 1 point
    Steven, If Stefan BMR's routine doesn't do what need, then you need to look for OCR software (Optical Character Recognition), this ability can be found in PDF and Raster to Vector programs. There are a few out there that might do what you need and if it is only one drawing that needs converting just try the demos as some of them are quite expensive.
  41. 1 point
    Steven, I don't know if you have access to The Swamp, but Marko Ribar created a routine which might work for you. It is similar to the Blockify command in Bricscad, where you can make blocks from similarly arranged entities (in your case lines which form letters), I can't test it as I am already using Bricscad so have no need for it but it may help you select the "letters". http://www.theswamp.org/index.php?topic=55186.0
  42. 1 point
    There are no fixed rules on this (at least nothing that I know of), but with dynamic blocks 'things' happen. Sometimes with existing blocks after you make an edit in the block editor the changes are made in existing blocks, other times they don't work, in that case all you can do is delete the old block and insert it again, especially when you are just testing and developing a new block.
  43. 1 point
    Metric makes it easy 1000/scale = multiply factor, so 1:50, dist/20 = true distance, but as mentioned, if FIT used to print even more likely to be wrong.
  44. 1 point
    Excellent! Thank you very much @pkenewell. That was just what I needed
  45. 1 point
    When you edit the text you find Text Editor in Ribbon.
  46. 1 point
    If one opens this file (and the backup file) in a text editor programme, all one sees is a continuous word of 180 pages length. It is all the same character which is usually an invisible one that cannot be seen in Wordpad, but is seen in Word if one sets it up correctly. So, even if the file started life as a drawing file, it is now nothing as all the data has been overwritten.
  47. 1 point
    hi, you only can write to asciii file, e.g .dxf, txt, csv etc.., but not a drawing file do you mean open a new drawing? just curious ac2007 ([color="blue"]ascii[/color] "\U+6C49") [color="green"];returns only 92 the first char[/color]
  48. 1 point
    (vl-string->list "ABC") does return (65 66 67). For ASCII characters, it works. What about international characters? (vl-string->list "ه") returns (92 85 43 48 54 52 55), which turns out to be \U+0647 And dismayingly, in my dwgcodepage ANSI_936, (vl-string->list "啊") returns (176 161) rather than its unicode which should be \U+554A
  49. 1 point
    I just did this with 2017 LT no problems, just a thought check the variable bactionbarmode=0 otherwise you will get a different visual Edit You posted just before me yeah bactionbarmode is your problem
  50. 1 point
    Play around this one You can easily write your own user defined function I called them 'helpers' ;;demo.lsp ;; helpers (defun write_to_end (wrdapp text / endrange) (setq endrange (vlax-get-property (vlax-get-property (vlax-get-property (vlax-get-property wrdapp 'ActiveDocument) 'Paragraphs) 'Last ) 'Range ) ) (vlax-invoke-method endrange 'InsertAfter text) ) (defun write_to_place (wrdapp num text / endrange) (setq endrange (vla-item (vlax-get-property (vlax-get-property wrdapp 'ActiveDocument) 'Sentences) num ) ) (vlax-invoke-method endrange 'InsertAfter text) ) ;; main prog (defun C:demo(/ docname wrdapp wrddoc wrddocs wrdrange) (setq docname (getfiled "Select Word Document" (getvar "dwgprefix") "doc;dot;*" 16)) (alert "Wait For Closing Word Application") (setq wrdapp (vlax-get-or-create-object "Word.Application")) (vla-put-visible wrdapp :vlax-true) (vlax-put-property wrdapp 'ScreenUpdating :vlax-false) (setq wrddocs (vlax-get-property wrdapp 'Documents)) (vlax-invoke-method wrddocs 'Open docname :vlax-false) (setq wrddoc (vlax-get-property wrdapp 'Activedocument)) (vlax-invoke-method wrddoc 'Activate) (write_to_end wrdapp "Now it is the last line in the document" ) (write_to_place wrdapp 2 "Now it is the first sentense in the second line in the document" ) (vlax-put-property wrdapp 'ScreenUpdating :vlax-true) (vlax-invoke-method wrddoc 'Saveas docname ) (vlax-invoke-method wrddoc 'Close) (vlax-invoke-method wrdapp 'Quit) (mapcar (function (lambda (x) (vl-catch-all-apply (function (lambda () (progn (vlax-release-object x) (setq x nil) ) ) ) ) ) ) (list wrddoc wrddocs wrdapp) ) (gc) (princ) ) (prompt "\n\t\t>>>\tType DEMO to execute\t<<<" ) (prin1) ~'J'~
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...