Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Public Sub alantest() Dim objent As AcadObject pick = True 'WHILE PICKING ENTITY Do While pick ThisDrawing.Utility.GetEntity objent, basepnt, "Pick line : " 'WHILE PICKING ENTITY If objent.ObjectName = "AcDbLine" Then ' If condition is True. Dim oLine As AcadLine Set oLine = objent With oLine MsgBox "StartPoint: " & .StartPoint(0) & ", " & .StartPoint(1) & ", " & .StartPoint(2) & vbCrLf & _ "EndPoint : " & .EndPoint(0) & ", " & .EndPoint(1) & ", " & .EndPoint(2) End With Else pick = False ' Set value of flag to False. MsgBox "object is not a line " & objent.ObjectName End If Loop End Sub
  3. Search export object data its like attributes just approached in a different way.
  4. BIGAL

    Need help with gap line lisp

    My $0.05 avoid initget, (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (if (= *mygap* nil)(setq *mygap* 0.125)) (setq *mygap* (atof (nth 0 (AH:getvalsm (list "Gap value" "Enter gap value" 10 8 (rtos *mygap* 2 3 )))))) This is the latest version of Multi getvals.lsp Multi GETVALS.lsp
  5. BIGAL

    Change PDF Plot Settings by Lisp

    Like Ronjonp I had something similar with multi floor printing, Rather than rewrite all the which printer? I get the persons id and then set to correct printer on that floor, using a lisp to plot rather than use publish. In the case of pdf's it put them into a specific directory attached to the dwg creating if not exist. Only 1 program for around 20 people. Pretty easy to change their location just change the printer name. We had Mono, Colour lasers and A0 plotter. We also use network printers with the pc3 files in one location. You can change the preferences for printer locations via lisp, I have a setup lisp that way all the network paths are correct and done instantly. Laptops had two icons Autocad & Home and work this way as it runs all the correct pathing, using the profile switch, we set up the laptops with the majority of stuff required to reflect same as office. Its about having everything server based.
  6. Just change the actual text value ? Not its Z. Text Add num to txt.lsp Multi GETVALS.lsp
  7. BIGAL

    Divide w/ Input

    The equals are easy with a "Variable" and a shortening of the overall as per other post, not sure what you want for ABCDE and F again easy but what are the parameters for A-F Just need what is max for EQ.Is it 6" and Variable then its simple maths. Overall/(6+variable) and end tolerance offsets.
  8. BIGAL

    Using LISP to Import From Excel

    It rates as perhaps the top topic Autocad < - > Excel so many posts. It is not that hard with the right lisp tools, you basicaly get a row - column value from excel. There are plenty of examples if you google or just start here you should be able to find what you want. An example of code is Getexcel.lsp. Others will suggest. If you post an xls and a dwg with some notes about what goes where some one here may be able to do something quickly.
  9. BIGAL

    Lines to Search in Excel

    So how do you know now what is a gold and silver line ? Is it to do with length orientation some sort of key to be searched on.
  10. As I said something like this its hard coded for output file location, you need to just pull out the few lines that do the ssget "WP" I just used it and it worked on your sample dwg after I added some text. Your requested program has 3 requirements pline co-ords text and circle centres. It needs to be purpose written.
  11. Yesterday (19 March 2019) I attended the Australasia BricsCAD Conference 2019 (ABC2019) at the Brisbane Conference and Exhibition Centre. The presenters were Michael Smith, Heidi Hewett, Pieter Clarysse, Damian Harkin, Jason Bourhill, Ralph Grabowski, Jonathan Taylor and myself. I wasn’t entirely happy with my own presentation, which I shared with Heidi Hewett. It started with an uncooperative PowerPoint wasting too much of the short time I had available. This led to me abandoning my painstaking preparations and winging it in order to finish in time for the closing address. I hope my talk was informative nevertheless. To see what went … The post What happened at the Australasia BricsCAD Conference 2019 appeared first on cad nauseam. View the full article
  12. You are correct in that the MASSPROP command will not display section modulus. MASSPROP will give you the two elements you need to calculate the section modulus. Those two elements being the Moments of Inertia and the bounding box dimensions. Section modulus units are indeed mm^3 or cm^3. See the screenshot taken from the dwg I uploaded previously. To enable such a listing of these section properties, a block that has particular attributes, has to be inserted in the drawing. (Exploded if necessary). The shape you have drawn is a region with the hollows correctly subtracted. That is good. When running the lisp routine select the region first and then immediately select the block. If you need a block and the lisp written by Tharwat (slightly modified by me but still credited to Tharwat of course), I can upload them here. The question would be what units would you be expecting? I assume your shape is drawn in mm. Do you need the resultant section modulus in mm^3 or cm^3. Do you need the weight as part of the listing also? in kg/m? If you do, the density of the concrete is required. It may be something like 2.32 g/cm^3 Alternative: - If you just need the section modulus only, maybe this will suffice. See the link: - https://www.cadforum.cz/cadforum_en/download.asp?fileID=1016 This is a protected lisp. With extension .vlx Not everybody is happy to activate such a routine without knowing what's inside it. I have used it for many years without any problems. (Just saying). Hope this post helps.
  13. You're very welcome Tharwat. Credit where it's due.
  14. Yesterday
  15. rlx

    auto area calculation table

    Allways dangerous to post a not fully tested routine ... but here ya go... still a little bug in getting area right for square with a broken vertex in it , as in your sample dwg , but selecting 'Show real area' should take care of that gr. RLX RlxDimensionPolyline.lsp
  16. Hi Roy, sorry for disturbing you again, A small help required, Actually i want to remove the line 3 from some of the Mtext, i already have a lisp(please check the attached) which removes the line 3, but after that if i use your above code to remove NC, it goes screwy(please check attached screenshot), could you please check with attached sample file. (defun LM:csv->lst ( str sep pos / s ) (cond ( (not (setq pos (vl-string-search sep str pos))) (if (wcmatch str "\"*\"") (list (LM:csv-replacequotes (substr str 2 (- (strlen str) 2)))) (list str) ) ) ( (or (wcmatch (setq s (substr str 1 pos)) "\"*[~\"]") (and (wcmatch s "~*[~\"]*") (= 1 (logand 1 pos))) ) (LM:csv->lst str sep (+ pos 2)) ) ( (wcmatch s "\"*\"") (cons (LM:csv-replacequotes (substr str 2 (- pos 2))) (LM:csv->lst (substr str (+ pos 2)) sep 0) ) ) ( (cons s (LM:csv->lst (substr str (+ pos 2)) sep 0))) ) ) (defun LM:csv-replacequotes ( str / pos ) (setq pos 0) (while (setq pos (vl-string-search "\"\"" str pos)) (setq str (vl-string-subst "\"" "\"\"" str pos) pos (1+ pos) ) ) str ) ; mtext find remove (defun C:jobs ( / ent strent ans newline x k ssmtxt ) (command ".undo" "m") (setq ssmtxt (ssget (list (cons 0 "Mtext")))) (repeat (setq k (sslength ssmtxt)) (setq strent (vlax-ename->vla-object (ssname ssmtxt (setq k (- k 1))))) (setq str (vla-get-textstring strent)) (setq ans (LM:csv->lst str "\\" 0)) (setq newline (nth 0 ans)) (setq x 1) (repeat (- (length ans) 1) (if (= (wcmatch (strcase (nth x ans)) "PJOB*") T) (princ) (setq newline (strcat newline "\\" (nth x ans))) ) (setq x (+ x 1)) ) (vla-put-textstring strent newline) ) ; repeat ) sample_.dwg
  17. See below. FeatId, OBJECTID, ANCILLARYR, & ENABLED are all associated within Autocad as 'Object Data' (OD). They are just attributes associated with an object given to provide additional information where necessary. You can Mapexport/Mapimport the points with this Data as well.
  18. @Shablab What is meant by 'object data'?
  19. Roy_043


    @rlx Aha, sorry I missed that remark. Note 1: According to BricsCAD (the program I use) two additional characters are not allowed in blocknames: " and `. "<>/\\\":?*|,=`;" Note 2: The code in this topic will not handle text with a 'random' OCS properly.
  20. dlanorh

    Need help with gap line lisp

    No problem, but I'm not sure which version solved it.
  21. ronjonp

    Change PDF Plot Settings by Lisp

    Glad to help. I've had this setup this way for nearly 20 years now and it works great. One caveat is if you have people that take home laptops .. then they won't be able to print without reconfiguring the plotter path.
  22. marko_ribar

    Overkill 'match' selectionsset

    You have to implement OVERKILL command inside LISP and then instead of using OVERKILL command you use LISP instead... Try this - it worked for me : (defun c:selremainafteroverkill ( / fuzz ss el rl dl p s i e k ) (initget 6) (setq fuzz (getreal "\nFuzz factor for OVERKILL <1e-4> : ")) (if (null fuzz) (setq fuzz 1e-4)) (setq sss (ssadd)) (setq ss (ssget "_A" (list (cons 410 (if (= 1 (getvar 'cvport)) (getvar 'ctab) "Model"))))) (if ss (progn (setq el (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (ssget "_:L") (vl-cmdf "_.-overkill" "_p" "" "_o" fuzz "_i" "_a" "_p" "_y" "") (foreach ee el (if (entget ee) (setq rl (cons ee rl)) (setq dl (cons ee dl)) ) ) (vl-cmdf "_.undo" "1") (setq k 0) (foreach ee dl (setq p (vlax-curve-getpointatparam ee (/ (+ (vlax-curve-getstartparam ee) (vlax-curve-getendparam ee)) 2.0))) (setq p (trans p 0 1)) (setq s (ssget "_C" p p)) (if s (progn (repeat (setq i (sslength s)) (if (vl-position (setq e (ssname s (setq i (1- i)))) rl) (ssadd e sss) ) ) (entdel ee) ) (setq k (1+ k)) ) ) ) ) (if (/= (sslength sss) 0) (progn (prompt "\nCurves that haven't been erased by OVERKILL are highlighted - there are : ") (princ (sslength sss)) (prompt " curves in remaining sel.set... Selection set is stored in \"sss\" variable...") (sssetfirst nil sss) ) (setq sss nil) ) (if (/= k 0) (progn (prompt "\n") (princ k) (prompt " curves couldn't be OVERKILLED - they are unerased because they were out of visible screen during operation...") ) ) (princ) ) HTH., M.R.
  23. woodman78

    Change PDF Plot Settings by Lisp

    Thanks for the help guys. i appreciate it. I will try that ronjonp.
  24. ronjonp

    Change PDF Plot Settings by Lisp

    Why don't you have this pc3 file shared on a network location? Then you can make all the changes needed and point the computers to the new location: (vla-put-printerconfigpath (vla-get-files (vla-get-preferences (vlax-get-acad-object))) "O:\\Network drive" ) ;; Or (setenv "PrinterConfigDir" "O:\\Network drive") or
  25. maratovich

    Change PDF Plot Settings by Lisp

    It is only possible to use Publish. See for an example
  26. Steven P

    Change PDF Plot Settings by Lisp

    I have looked for similar and the answer I was getting was it can't be done.... I would like to be corrected though! My solution was to make up a custom settings for the PDF plotter with what I needed (do it once) and then when I want to plot the LISP selects this custom setting - which is something you don't want to do but a few minutes setting that up lets you do what you want (and it has paid me back lots with time saving with my plotting)
  27. I did not know about this command and it gets me 85% there. I do not see where to export Object Data with this though. If it's an option within and I'm just missing this then it should give me everything I need. That Lisp seems to work well but it only exports (X, Y, Z) and doesn't give me an Object Data with the points
  1. Load more activity
  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
  • Create New...