Jump to content

Search the Community

Showing results for tags 'lisp lsp'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions


  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 20 results

  1. hey Guys, I am hoping someone can let me know what is incorrect about my approach here. I have created 2 routines: IMP-CUI: which renames the old "acad.cuix" and bring in my updated one (do not ask why I did not use "vl-file-copy" method as the result was not satisfactory for me anyways). 2016N: which import the profile from a server location and renames the "...(US Metric)" first to then replace it with an updated one with the same name. The result is quite random when I try it on different computers with the same version. Although I can see that the profile is imported, it does not always carry my setting. I keep losing my supported path, etc... each time I twick the routine. My acad.cuix is updated and when I import it manually seems to have all of my options including the checked and unchecked boxes and supported files. I am tried of trying really! the funny thing is that my partial cuix menus load with no issue, but my preferences on option setting is random even on the same computer when I reset setting to default. Can anyone help PLEASE! Recently enough BIGAL was telling me something about .MNR or .MNL files but I have no idea how to process those. Thanks, Bother in need! hah! (defun c:IMP-CUI () ;;; FIND THE USER (setq loginname (getvar "loginname")) ;;; RENAME THE ORIGINAL "acad.cuix" TO "acad_OLD.cuix" (vl-cmdf "shell" (strcat "ren " "\"" (strcat "C:\\Users\\" (getvar "loginname") "\\AppData\\Roaming\\Autodesk\\ACA 2016\\enu\\Support\\acad.cuix") "\" \"" "acad_OLD.cuix" "\"")) ;;; COPY THE UPDATED "acad.cuix" FROM SERVER ONTO SUPPORT FOLDER (command "REGEN" "") (vl-cmdf "shell" (strcat "copy " "\"" "V:\\SALLE A DESSIN\\SAM - OUTILS XLS DWG\\3-LSP XLS\\AutoCAD-PROFILE-CUI MIGRATION\\2016\\acad.cuix" "\" \"" (strcat "C:\\Users\\" (getvar "loginname") "\\AppData\\Roaming\\Autodesk\\ACA 2016\\enu\\Support\\") "\"")) (vl-load-com) (princ) (command "_.close" "_N" "") ); END DEFUN (defun c:2016N () ;---------------------------------------------- PROFILE ----------------------------------------------; ;;; ALL PROFILES "Profilelst" (setq Profilelst (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object))) ) ;;; "CurrentActive" TO STORE ACTIVE PROFILE (setq CurrentActive (vla-get-ActiveProfile Profilelst) ) ;;; RENAME THE "CurrentActive" IF IT IS: "AutoCAD Architecture (US Metric)" (if (= CurrentActive "AutoCAD Architecture (US Metric)") (vlax-invoke-method Profilelst 'RenameProfile CurrentActive "OLD_Profile") ) ;;; IMPORT PROFILE (setq ImpProfile (vlax-invoke-method Profilelst 'ImportProfile "AutoCAD Architecture (US Metric)" "V:\\SALLE A DESSIN\\SAM - OUTILS XLS DWG\\3-LSP XLS\\AutoCAD-PROFILE-CUI MIGRATION\\2016\\AutoCAD Architecture (US Metric).arg" :vlax-true ) ) ;;; SET "AutoCAD Architecture (US Metric)" AS ACTIVE PROFILE (vla-put-ActiveProfile Profilelst "AutoCAD Architecture (US Metric)" ) ;;; RESET PROFILE (vlax-invoke-method Profilelst 'ResetProfile "AutoCAD Architecture (US Metric)" ) ;;; DELETE "AutoCAD Architecture (US Imperial)" IF EXIST (repeat (vlax-invoke-method Profilelst 'DeleteProfile "AutoCAD Architecture (US Imperial)" "OLD_Profile" "AutoCAD" ) ) (vl-load-com) (princ) ); END DEFUN I FOUND THAT IF I RESET THE PROFILE, IT MESSES UP WITH THE GENERAL SETTING AND REMOVES MAPPING FOR SUPPORTED PATHS! RIGHT NOW WITHOUT THE RESET FUNCTION EVERYTHING SEEMS DANDY AFTER A COUPLE OF TRIES.
  2. Does anyone know where the file is saved each time you load the "LIST" that you saved on this amazing LISP? http://www.lee-mac.com/bfind.html The reason I am asking is because I would like to transfer my list onto another computer but I cannot find where the file is located when you save your list to then "Load search items list"! Thanks
  3. Would anyone help me find and change certain setting I would like to change under Options or preferences: 1) I would like to load and unload a buck of CUIX files - but as always the menu will not show up - I have to then manually do CUILOAD and unload and reload the menus to appear on menu bar. 2) This is taken from BIGAL: (vlax-dump-object (vla-get-files (vla-get-preferences (vlax-get-Acad-object))) T) which helped me a lot in finding many of the settings but I still need to change many more. 3) Anyone please help to find: ; SET OPEN AND SAVE TAB/FILE SAVE/SAVE AS: ; AutoCAD 2013 Drawing (*.dwg) ; AND ; UNDER FILE SAFETY PRECAUTIONS: ; UNCHECK: "Automatic Save" ; SYSTEM TAB/GENERAL OPTIONS ; CHECK "Beep on error in user input" my biggest problem is loading and unloading that results in menus being loaded but not shown on the menu bar: ; UNLOAD "ACA.CUIX" ; LOAD "ACA 20##" ; LOAD ACA FROM "C:\Users\[User]\AppData\Roaming\Autodesk\ACA 20##\enu\Support\ACAD.cuix" ; LOAD ACAD.cuix ; CUSTOM.cuix ; Appmanager.cuix ; acetmain.cuix ; Featuredapps.cuix ; Modeldoc.cuix ; RadicalPurge.cuix I posted something similar and no one replied and many of my questions were resolved by searching through web. But Can anyone help me with those please? Thanks
  4. Below is BIGAL`s wonder from 2011. All of which are amazing and never knew could be done! Imagine a 2020 BIGAL!!! Basically what I was trying to accomplish was to setup or configure my computer to then save the setting for any other but some tasks are proven impossible or not done efficiently. I did use to import workspace and get some of the task done but if there is a way to combine all the features with a lisp, I would be more satisfied. That is to be able to change a certain controls within "Options" settings as well as adding search path for lisp, trusted path, printed path and other controls. Does anyone have a hand into this or a way of instructions as to how my tasks can be done? presently, I have to add each item on the list manually, CUI settings, control other settings and set some criteria one by one. Is there any genius that can help me achieve this? Also due to variety in autocad version, I have to constantly save my workspace, then use a "Hotfix" by Autodesk to suit the version blah blah blah... Thanks ; resets the paths usefull for update versions of Autocad ; by Alan H 2011 ; This sets a reference to the install path of your product ; the gets are their for info maybe other use ; use this to find other settings ;(vlax-dump-object (vla-get-files (vla-get-preferences (vlax-get-Acad-object))) T) (vl-load-com) ; make temp directory ;(vl-mkdir "c:\\AcadTEMP") (setq *files* (vla-get-files (vla-get-preferences (vlax-get-Acad-object)))) ; savepath ;(vla-get-AutoSavepath *files*) (vla-put-AutoSavepath *files* "C:\\AcadTemp") ; custom icons ;(vla-get-CustomIconPath *files*)) (vla-put-CustomIconPath *files* "P:\\Autodesk\\ICONS") ; custom menu ;(vla-get-Menufile *files*)) ;(vla-put-Menufile *files* "C:\\Users\\2013BIGAL") ; printers config ;(vla-get-PrinterConfigPath *files*) (vla-put-PrinterConfigPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles 2011") ; printers style sheet ;(vla-get-PrinterStyleSheetPath *files*) (vla-put-PrinterStyleSheetPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles") ; printer drv's ;(vla-get-PrinterDescPath *files*) (vla-put-PrinterDescPath *files* "P:\\AutoDESK\\Plotting\\Drv") ; print spooler ;(vla-get-PrintSpoolerPath *files*) (vla-put-PrintSpoolerPath *files* "C:\\AcadTemp\\") ; template path ;(vla-get-TemplateDwgPath *files*) (vla-put-TemplateDwgPath *files* "P:\\Autodesk\\c3d Templates") ; template location ;(vla-get-QnewTemplateFile *files*) (vla-put-QnewTemplateFile *files* "P:\\Autodesk\\c3d Templates\\BIGAL.dwt") ;make new support paths exist + new (setq paths (vla-get-SupportPath *files*)) (setq BIGALpaths "P:\\autodesk\\supportfiles; P:\\autodesk\\lisp; P:\\autodesk\\fonts; P:\\autodesk\\hfs fonts;" ) (setq newpath (strcat BIGALpaths paths)) (vla-put-SupportPath *files* newpath) ; Tempdirectory ;(vla-get-TempFilePath *files*)) (vla-put-TempFilePath *files* "C:\\AcadTemp\\") ; PlotLogFilePath = "C:\\Documents and Settings\\ah02490.BIGAL-AD\\local settings\\application data\\autodesk\\c3d 2011\\enu\\" (vla-put-PlotLogFilePath *files* "C:\\AcadTemp\\") ; LogFilePath = "C:\\Documents and Settings\\ah02490.BIGAL-AD\\local settings\\application data\\autodesk\\c3d 2011\\enu\\" (vla-put-LogFilePath *files* "C:\\AcadTemp\\") ; xref temp path ;(vla-get-TempXrefPath *files*)) (vla-put-TempXrefPath *files* "C:\\AcadTemp\\") ; end use of *files* (vlax-release-object *files*) ; exit quitely (princ "All Done") ;;; LOCAL MODE: ---> C:\Cad config ;;; NETWORK MODE customization setting ---> T:\SALLE A DESSIN\Outils CAD\Outils configuration ;;; NETWORK MODE CTD SLIDES ---> T:\SALLE A DESSIN\Outils CAD\Slides ; UNLOAD "ACA.CUIX" ; LOAD "ACA 20##" ; LOAD ACA FROM "C:\Users\[User]\AppData\Roaming\Autodesk\ACA 20##\enu\Support\ACAD.cuix" ; LOAD ACAD.cuix ; CUSTOM.cuix ; Appmanager.cuix ; acetmain.cuix ; Featuredapps.cuix ; Modeldoc.cuix ; RadicalPurge.cuix ; CHANGE VARIABLES ; Menubar 1 ; Startup 1 ; StartMode 1 ; CLOSE/ TERMINATE ALL PALETTES EXCEPT "Properties" & "External Reference" ; DOCK "Properties" PALETT TO LEFT ; DOCK "External Reference" PALETT TO RIGHT ; SET SELECT TEMPLATE *.dwt: NEW TEMPLATE ; PATH: T:\SALLE A DESSIN\Outils CAD\Template ; SUPPORTED FILE SEARCH PATH (LOCAL): ; C:\Cad Config\LISP ; C:\Cad Config\Slides ; C:\Transfer ; TRUSTED LOCATIONS (LOCAL): ; C:\Cad Config\LISP ; PRINTER SUPPORT FILE PATH (LOCAL) ; PRINTER CONFIGURATION SEARTH PATH: ; C:\Cad Config\Plotters ; PRINTER DESCRIPTION FILE SEARCH FILE: ; C:\Cad Config\Plotters\PMP Files ; PLOT STYLE TABLE SEARCH FILE: ; C:\Cad Config\Plotters\Plot Styles ; AUTOMATIC SAVE FILE LOCATION: ; C:\AcadTemp ; C:\Users\[User]\desktop\autosavecad ; TEMPLATE SETTINGS/DRAWING TEMPLATE FILE LOCATION: ; C:\Cad Config\Template ; SUPPORTED FILE SEARCH PATH (NETWORK): ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Plotters ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Lisp ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Slides ; TRUSTED LOCATIONS (NETWORK): ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Lisp ; PRINTER SUPPORT FILE PATH (NETWORK) ; PRINTER CONFIGURATION SEARTH PATH: ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Plotters ; PRINTER DESCRIPTION FILE SEARCH FILE: ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Plotters\PMP Files ; PLOT STYLE TABLE SEARCH FILE: ; T:\SALLE A DESSIN\Outils CAD\Outils configuration\Plotters\Plot Styles ; AUTOMATIC SAVE FILE LOCATION: ; C:\AcadTemp ; C:\Users\[User]\desktop\autosavecad ; TEMPLATE SETTINGS/DRAWING TEMPLATE FILE LOCATION: ; T:\SALLE A DESSIN\Outils CAD\Template ; SET OPEN AND SAVE TAB/FILE SAVE/SAVE AS: ; AutoCAD 2013 Drawing (*.dwg) ; AND ; UNDER FILE SAFETY PRECAUTIONS: ; UNCHECK: "Automatic Save" ; SYSTEM TAB/GENERAL OPTIONS ; CHECK "Beep on error in user input"
  5. The lisp below is lee macs Parsing numerical values from a text. I am wondering how to use this to change the colour within the selected Mtext only for real numbers that accompany "m", for example: 112.35m etc... <number> <dot> <number><m> sometimes there is one space between the real number and "m", so if I could first remove the space for every real number within the text for each, then change the colour for each. I gave it try and I seem not to be successful with this task. Thanks ;; Parse Numbers - Lee Mac ;; Parses a list of numerical values from a supplied string. (defun LM:parsenumbers ( str ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (mapcar '(lambda ( a b c ) (if (or (< 47 b 58) (and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) b 32 ) ) (cons nil l) l (append (cdr l) '(())) ) ) ")" ) ) ) (vl-string->list str) ) )
  6. Could someone let me know how to use put-string to arrange text by colour so that example: all content in colour #2 remain but contents in colour # 0 and #4 are removed without changing any of the text format or style? I looked up Wmatch but it seems I cannot get anywhere with that. (setq txt(vla-get-TextString(vlax-ename->vla-object (car (entsel))))) (vla-put-textstring obj ...) not quite sure how to deal with : "\\pxse1.01;{\\C2;TEXT1\\PTEST2\\PTEST3}\\P{\\C4;TEST4\\PTEST5\\PTEST6}" to separate specific colours and merge them. I am also thinking if I could ask which colour to remain, then any other colour could just be removed - this way not complication would arise from conditioning the colour numbers. it could simply be Colour #0 + any colour stored on "Colnum" variable to stay. (setq Colnum (getint "\nWhich Colour to Stay")) Any ideas? sample.dwg
  7. I am trying to retrieve the current dimension style on an open cad file to execute some of my other lisps instead of (Alert blah...), but am not successful. Could someone take a quick look at this and let me know where I am getting it wrong? i had a quick look at tblnext and tblsearch and I think it is right! but maybe VLA could do this more efficiently - I have not gotten too deep into LISP though. I also have two standards ( "STANDARD" and "Standard") depending on which one is the current dim style my code changes. is there a way to make it Case sensitive? ; condition based on current dim stlye ; "Tx Arial 1.65" "Tx CityBlueprint 2.38" "Standard" (defun c:test (/ D1) (setq D1 (tblnext "DIMSTYLE")) ; getting current dimstyle name (setq D1 (cdr (assoc 2 D1))) ; getting dimstyle name (while (/= D1 nil) ; if dimstyle is not nil then proceed (setq D1(tblsearch "DIMSTYLE" D1)) ;; searching for dimstyle (cond ( (= (cdr (assoc 2 D1)) "Standard") (alert "Standard is selected") ) ( (= (cdr (assoc 2 D1)) "Tx Arial 1.65") (alert "Tx Arial 1.65 is selected") ) ( (= (cdr (assoc 2 D1)) "Tx CityBlueprint 2.38") (alert "Tx CityBlueprint 2.38 is selected") ) ); end cond ); end while (princ) ) Please help SAMPLE DIMENSION.dwg
  8. I am not even sure how to pose this question - so here she goes: I am not quite sure if you can select content with different colours within a text (see attachment). The code below only finds text colour selected by the layer. Is there a way? My whole intention is to sort them so that say if I pick BELL (colour 150) or RORGERS (colour 22) then the white text strings and colour 150 remains and the rest be removed - sorting by colour and merging the text condition the selection and colour!!! Possible? (setq ss (ssget "X" '((0 . "*TEXT")(62 . 1)))) if yes...how??? text sample.dwg
  9. I am trying to make this work but sometimes it works and sometimes does not. Please bare in mind that I just learned POLAR function and it may not the efficient way. The radius through fillet I am choosing sometimes works but sometimes comes up with an error that radius is too big. Is there another way to deal with drawing this or could there be a way to add arc without fillet? could someone also please explain the ssget function and how I can select any object i create and store under a variable? say, in this case I want to select all my lines: how would I do it? Please describe with some details so I can learn. Thanks ;; PROGRAM TO DRAW TOWER ANGLE WITH 60 DEG. ANGLE ;; (defun c:TANG (/ stpt totang thkang brkang r1 r2 si1 si2 S1 rad1) ; General questions (setq stpt (getpoint "\n Pick a point:") totang (getreal "\n Enter Angle Size:") thkang (getreal "\n Enter Angle Web Thickness:") brkang (getreal "\n Enter Break Distance:") ) ; calculate arc (setq r1 (/ thkang 2) r2 (* thkang 1) ) ; calculate polar coordinate ;(polar refpoint angle distance) (setq si1 (sin (angtof "7.5"))) (setq si2 (sin (angtof "82.5"))) (setq S1 (* (/ thkang si2) si1)) (setq p1 stpt p2 (polar p1 (angtof "90") brkang) p3 (polar p2 (angtof "105") (- totang brkang)) p4 (polar p3 (angtof "195") thkang) p5 (polar p4 (angtof "285") (- (- totang brkang) S1)) p6 (polar p5 (angtof "270") (- (- brkang thkang) S1)) p7 (polar p6 (angtof "180") (- (- brkang thkang) S1)) p8 (polar p7 (angtof "165") (- (- totang brkang) S1)) p9 (polar p8 (angtof "255") thkang) p10 (polar p9 (angtof "345") (- totang brkang)) p11 (polar p10 (angtof "0") brkang) ) ; to draw the lines (setq rad1 (* thkang 0.75)) (command "line" p1 p2 "") (command "line" p2 p3 "") (command "line" p3 p4 "") (command "line" p4 p5 "") (command "line" p5 p6 "") (command "line" p6 p7 "") (command "line" p7 p8 "") (command "line" p8 p9 "") (command "line" p9 p10"") (command "line" p10 p11 "") (command "fillet" "_R" r1) (command "fillet" p3 p4) (command "fillet" p8 p7) (command "fillet" "_R" rad1) (command "fillet" p6 p5) (princ) ) ;end defun
  10. Hey guys, I am trying to create a label (see attached dwg) using lisp to; upon entering the command: 1) ask for prefix then keep this prefix in memory (in this case BM-SC- let's say) 2) I would just enter the number associated with any block until i change my prefix 3) create a block with the criteria (dwg attached) and attributes so I can edit the text if need be 4) simply insert it on paperspace 5) also to auto adjust the box width so it remain a certain width but if it exceeds blah mm then to fit and center text within the maximum box size instead of extending the box. I do not know where to begin or how to handle this. Is it even possible with a lisp to accomplish all this? I do have this as a dynamic block but it seems to be a redundant task after a dozen paste - I have to fit the text or adjust the box. Thanks label.dwg
  11. Could someone guide me through this challenge: I am trying to create a lisp to have sub commands (I am not even sure what you would call it) - and when I search sub command I get a bunch of none sense. My first list is: [Bolt/U-bolt/Pipe/Angle/Plate/Hss-square] then under "Bolt": [1-2/5-8/3-4] under "U-bolt": [1-2/5-8] under "Pipe": [General/73/89/102/114] under "Angle": only on dynamic block with all sizes under "Plate": only on dynamic block with all sizes under "Hss-square": [Square/Rectangle] I have no idea how to make sub commands or how to call them in order to call insert command. all blocks are on the same dwg, but they have funky name that does not represent their shape only the size. so on this lisp: each time I select a "sub-menu" for the lack of better words, I then would like to insert the block. Example: Bolt > 5-8 > then magically insert "blah" block from its insertion point. (if(not ttc:Mode)(setq ttc:Mode "Pipe")) (initget "Bolt U-bolt Pipe Angle Plate Hss-square") (setq oldMode ttc:Mode ttc:Mode (getkword (strcat "\nSpecify mode [Bolt/U-bolt/Pipe/Angle/Plate/Hss-square] <" ttc:Mode ">: ")) conFlag T paseStr "" ); end setq (if(null ttc:Mode)(setq ttc:Mode oldMode)) Could someone help me with this please?
  12. What I am trying to accomplish would be two selection types: 1) what the default texts would be + a manual option and 2) where on the dimension the override to happen. I seem not to be able to successfully select one of the options under (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual"): the manual is supposed to be for non default text. Can someone let me know what is wrong with this? This was my result before attempting to add the first option (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual"). Please help! (defun c:dimch1 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ; START OF SELECTION FOR ADDING TEXT ON DIMENSIONS (progn (initget "(Typ.) (TYpe.) (Plus-minus ±) Manual") (setq Rtrn (cond ((getkword "\nType [(Typ.)/(TYpe.)/(Plus-minus ±)/Manual] <Manual>: " ) ) ("Manual") ) ) ) ;(if ;(and (setq Manual (/= (setq txt (getstring t "\n Specify the Text string :")) "" ;)) (progn (cond ((= Rtrn "(Typ.)") (setq Txt "(Typ.)")) ((= Rtrn "(TYpe.)") (setq Txt "(Type.)")) ((= Rtrn "(Plus-minus ±)") (setq Txt "± ")) ((= Rtrn "Manual") (setq Txt Txt)) ) ;end 2nd. condition (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ; END OF SELECTION FOR ADDING TEXT ON DIMENSIONS (progn (initget "Above Below Prefix Suffix") (setq Rtrn (cond ((getkword "\nType [Above/Below/Prefix/Suffix] <Suffix>: " ) ) ("Suffix") ) ) ) ; end 1st. progn ;) ;end And (progn (cond ;((= Rtrn "Above") (setq Txt (strcat Txt "\\P<>"))) ;((= Rtrn "Below") (setq Txt (strcat "<>\\P" Txt))) ;((= Rtrn "Prefix") (setq Txt (strcat Txt " <>"))) ;((= Rtrn "Suffix") (setq Txt (strcat "<> " Txt))) ((= Rtrn "Above") (setq Txt (strcat "{\\fArial|b1|i0|c0|p34;" Txt "}" "\\P<>"))) ((= Rtrn "Below") (setq Txt (strcat "<>\\P" "{\\fArial|b1|i0|c0|p34;" Txt "}"))) ; replace it with <>\X{\fArial|b0|i0|c0|p34;(Type)} ((= Rtrn "Prefix") (setq Txt (strcat "{\\fArial|b1|i0|c0|p34;" Txt "}" " <>"))) ((= Rtrn "Suffix") (setq Txt (strcat "<> " "{\\fArial|b1|i0|c0|p34;" Txt "}"))) ) ;end 2nd. condition (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ;) ; end if (princ) ) ;End Defun
  13. how do I get the first part to work? how do I combine the two? How do I have it so first pline is drawn/executed, followed by then (c2 command) measure command to insert specific block and then (c3 command) which is offset on both sides and delete original is executed? as you can see it looks so bad... please help (defun c:c2 (/ d1) (setq d1 (entget (car (entsel)))) (setq d2 (command "_.measure" "d1" "B" "Tx - Dalle béton + tapis" "Y" "1200" "")) ) (vl-load-com) (defun c:c3 ( / *error* of undo doc ss ) (defun *error* ( msg ) (and undo (vla-EndUndomark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE"))) (setq of (getdist "\nSpecify Offset Distance: "))) (progn (setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))))) (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc)) (mapcar (function (lambda (o) (vl-catch-all-apply (function vla-offset) (list obj o)))) (list of (- of))) (vla-delete obj)) (setq undo (vla-EndUndoMark doc)))) (princ) )
  14. Could someone take a look at this lisp and let me know how I can get true north based on the North Symbol attached to remember my last pick so I can enter values as angle once the true north is set - I am thinking something like Offset command that keeps last entry if it is at all possible. Attached is the north symbol I am using on my projects but to orient antenna blocks to say 40 degrees from true north, then I have to go through selection process instead of value entry each time. Thanks (defun c:test (/ ss p1 oan nan rot) (princ "\n Select objects to Rotate: ")(terpri) (setq ss (ssget)) (setq p1 (getpoint "\n Center Point of Rotation: "))(terpri) (setq oan (getangle "\n Existing Angle Direction to be Corrected: "))(terpri) (setq nan (getangle "\n New Angle Direction: "))(terpri) (setq rot (/ (* (- nan oan) 180) pi)) (command "rotate" ss "" p1 rot) (princ) ) ;End Defun
  15. I did use STEAL lisp by MAC LEE before but since I am not inserting blocks anymore (Thousands of blocks on master general blocks), also because STEAL mess up the draw order on the hatch in dynamic blocks, is there a way: Upon entering a command to copy a selection coordinates from the source file and let user choose a place to paste them on the destination file; example: Cables <Enter> (go to D:/blocks/general blocks.dwg) and copy from specific coordinates and let me paste them to where I want on my current cad file? Thanks
  16. I have seen so many lisps to change the draw order or send hatch to back, but would there be a way to: My dynamic blocks are on layers 0 and defpoint; 1) upon inserting a dynamic block 2) preserve the block draw order or 3) send wipeout at the very back 4) Defpoint layer lines, plines, arc, circles before wipeout 5) Solid hatch before wipeout 6) Hatch ANSI32 & ANSI33 on top of Solid hatch 7) Text or dimension in Defpoint layer on top of solid hatch 8)All lines,plines, arcs, circles, etc at the very top if someone scrambles something I would really appreciate it.
  17. How can I return the osmode to user's previous mode after running any of my lisp? Could you please help? Thanks
  18. Sambuddy

    Menu update

    I am trying to load this menu using this code: (do not laugh if it looks dumb)! (defun c:MENLD (/ f) (if (setq f (getfiled "V:\\SALLE A DESSIN\\SAM - OUTILS XLS DWG\\3-LSP XLS\\MENU\\TOWER.cuix")) (progn (setvar 'filedia 0) ;(command "_.menuunload" (vl-filename-base f)) (command "_.menuload" f) (setvar 'filedia 1) ) (print "TOWER.cuix found...") ) (princ) ) The reason I wanted to do this was to update my menu each time someone changes something - But I think I am super beginner. is there a way to update your menu based on the address I provided - even if I have it already on my menubar? I guess unload previous and then load again from that address. Thank you all
  19. Please see below the lisp I have been using to align blocks I had referencing a line. On the snapshot above, as can be seen, the block (customized text leader block) my reference block is at the tip of the leader and not as i prefer (Position2) on this specific block. Can someonw let me know how I can manipulate this lisp so it would take Position2 as a point to align and not 0,0 "Position". The reason for doing this is the leader pointer can be dragged but I would like the alignment to happen on that fixed "Position2". This lisp works well with my other blocks I need to align due to the proper placement of 0,0. alternatively, is there a way, if I cannot specify "Position2", to select which point I would like to be aligned? Thanks (defun C:alit () (prompt "\nPick base line upon which project/align objects:") (setq ent (entsel)) (setq pt2 (cadr ent)) (setq nlin (car ent)) (setq pt2 (osnap pt2 "Nea")) (prompt "\nSelect texts/blocks to project/align: ") (setq conj (ssget)) (setq num 0) (setq con (ssadd)) (setq lon (sslength conj)) (repeat lon (setq name (ssname conj num)) (setq lst (entget name)) (setq tip (cdr (assoc 0 lst))) (if (or (= tip "TEXT")(= tip "INSERT")) (ssadd name con) ) (setq num (+ 1 num)) ) ; end repeat (setq lon1 (sslength con)) (setq num1 0) (repeat lon1 (setq e1 (entget (ssname con num1))) (setq pt1 ( cdr (assoc 10 e1))) (setq name (cdr (assoc -1 e1))) ( command "line" pt1 (osnap pt2 "per") "") (setq pfin (cdr (assoc 11 (entget (entlast))))) (command "_erase" (entlast) "") (command "_move" name "" pt1 pfin) (setq num1 (+ 1 num1)) );end repeat (initget "Yes No") (setq what (getkword "\n¿Erase base line? (Y/N) <Y>: ")) (if (= what nil)(setq what "Yes"));end if (cond ((= what "Yes")(command "_erase" nlin "")) ); end cond (princ) ) ; end defun
  20. Hello every one... Sorry if i have posted in wrong forum. I am quite new to this forum. I have searched these forums for this code but i was not able to find it. I am working with this daily routine of copying a block or some lines or plines to multiple co-ordinates and i am tired of it. Here is the routine that i follow. 1) copy (a set of lines) and specify a base point (usually a center). 2) pasteclip and enter coordinates manually at the prompt (specify insertion point). 3) pasteclip and enter coordinates manually again and again. All I want to do is to copy the object or lines and then specify a csv file for the insertion point(s). Thanks in advance.
  • Create New...