Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Almost every project should be on here AFAIK. Student Project Questions - AutoCAD Forums Here is the Oleson Village... Penn Foster Student Suffering with Oleson Village Map!!! - Student Project Questions - AutoCAD Forums
  3. Today
  4. OK folks, new guy here. So far in my research it sounds like Penn Foster should have their own dedicated forum. I was wondering if there was somewhere projects are posted so we can compare to be sure we've done stuff correctly? I submitted my "Oleson Housing Development" project and received a 15% because "the scale was off". Needless to say, I was less than impressed. I've sent weeks working on this project for the third semester between working overtime and sleep so I want to be sure I don't get a grade like that again. Thank you in advance for any help
  5. Nikon

    Breakline in lines...help

    Alternative option. You can use a dynamic block with a selection of different states. You can change the block scale. Breakline.dwg
  6. Akash_SAK

    2 Step Command Alias in PGP File

    Thankyou Bigal for the information and may i know that where would be the autocad Lisp package file is available on PC ?
  7. @bigal, Reminds me of the days of HP9830, used to work on preliminay studies in the James Bay area. I would start calculating a long polygon in geodetic coordinates then go in the tent where we had a pool table and shoot two racks. Go back to the office tent still had to wait some. The hp9830 had but 8k core memory and a cassette tape. So the need for speed depends on the situation. For the basic A* it's all about it and the hack proposed by @GLAVCVS is totally worth it. The polygon making not so much, but I tend to be biased in favor of vanilla autolisp.
  8. Does anyone know how to get a hold of the developer of this app? It does exactly what I want, but am unable to purchase a license through the app as the link no longer works and I have had no luck contacting the developer from their company page. Their company page at www.debalance.com also pops up a warning that it may not be safe upon opening, and is not a secure site. Do the mods at CADTutor have any way to contact the author? It seems he used to be quite active on the boards here. Anyways, great little plugin, it just seems too bad there is no way to buy a license!
  9. Yesterday
  10. We talk a lot about speed but does it matter, if it take seconds or a minute, a task I worked on could take up to 3 hours manually it takes 2 minutes now. I improved the speed 3 times by recoding. Yes if have thousands of lines go get a coffee. still faster than having a go manually. I guess what I am saying are we talking seconds, minutes or hours ? 13 seconds for 5000, I would call that fantastic. If worried about time add a progress bar it's a Acet function. The task above started at like 25 minutes to do, so 2 minutes as final version is considered acceptable by me. Yes talking thousands of changes.
  11. BIGAL

    Setting HPANNOTATIVE

    Like @Steven P my Autoload.lsp has around 35 defuns in it plus some setvar's and uses the Appload add to Startup suite, Acad or Bricscad works.
  12. ronjonp

    Breakline in lines...help

    Here's an old one CAB wrote. dz.lsp
  13. As @Steven P suggested you can have as many plot predefined settings as you want. Did you test the "getpropertyvalue" code in your LT as per my request above. I don't have LT so can not test.
  14. hello: Does anyone have something that does this or something similar? Break the lines and draw those symbols Any comments are welcome, thank you.
  15. Admin posted twice.
  16. When I plotted the layout to PDF the table came out Ok. Tried a couple of things like draworder etc but they had no effect. Ok a way around it, copy the table to clipboard and paste in MODEL, go back to layout make a new viewport in layout set UCS W PLAN zoom in on table etc and set a suitable scale, shrink the viewport close to the table move the viewport over the two other viewports. I am sure if I played more could work out viewport scale so correct text height. Ps set viewport outline to "No Plot".
  17. I don't know but I used "Benchmark.lsp | © 2005 Michael Puckett " to do the testing. Logically yours has to be slower because you run through the list so many more time either with apply (function append plus a mapcar for each element of the list to to Float the coordinates. Bear in mind it will only matter if the path found has a lot of coordinates. ymg
  18. I use that code to create 3D polylines because it’s shorter, although I know that 'apply' slows it down a bit. However, I didn’t think it would be as much as you say. I was just about to reply with that. But at the last moment, I managed to find a bit of time — and curiosity — to run a test. And my results are somewhat different from what you describe. I should mention that my test was carried out in AutoCAD 2002, using a list of 93 points previously stored in the variable 'plst'. The code I used for this test is attached below. (defun Original_f3Dpol (pts / tmp f3Dpol) (defun f3Dpol (pts / ep ll la e) (setq ep (if (= 1 (getvar (quote cvport))) (vla-get-PaperSpace (vla-get-activedocument (vlax-get-acad-object))) (vla-get-modelSpace (vla-get-activedocument (vlax-get-acad-object)))) ll (apply (function append) pts) la (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble (cons 0 (1- (length ll)))) (mapcar (function float) ll)) e (vla-Add3DPoly ep la) ) (vla-put-Color e 1) (vla-put-Layer e "0") (vla-put-Lineweight e 0.4) ) (setq tmp (car (_vl-times))) (repeat 5000 (f3Dpol plst) (entdel (entlast)) ) (prompt "\nOriginal \'f3Dpol\' Elapsed time (5000 iterations): ") (princ (rtos (/ (- (car (_vl-times)) tmp) 1000.0) 2 50)) (prompt " seconds.") (princ) ) (defun ymg_f3Dpol (plst / tmp f3Dpol) (defun f3Dpol (plst / sa i p element sa obj ) (setq sa (vlax-make-safearray vlax-vbDouble (cons 0 (1- (* (length plst) 3))))) (setq i 0) (foreach p plst (foreach element p (vlax-safearray-put-element sa i (float element)) (setq i (1+ i)) ) ) (setq obj (vla-Add3DPoly (vla-get-modelSpace (vla-get-activedocument (vlax-get-acad-object))) sa)) (vla-put-Color obj 1) (vla-put-lineweight obj 0.4) ) (setq tmp (car (_vl-times))) (repeat 5000 (Y3Dpol plst) (entdel (entlast)) ) (prompt "\nModified @ymg3 \'f3Dpol\' Elapsed time (5000 iterations): ") (princ (rtos (/ (- (car (_vl-times)) tmp) 1000.0) 2 50)) (prompt " seconds.") (princ) ) (defun ymg_mk_3dp (lst / tmp mk_3dp) (defun mk_3dp (lst / vtx) (if (and (> (length lst) 1)) (progn (entmakex (list '(0 . "POLYLINE") '(10 0. 0. 0.) (cons 8 "0") (cons 62 1) (cons 370 40) '(70 . 8) ) ) (foreach vtx lst (entmakex (list '(0 . "VERTEX") (cons 10 vtx) '(70 . 32) ) ) ) (cdr (assoc 330 (entget (entmakex '((0 . "SEQEND")))))) ) ) ) (setq tmp (car (_vl-times))) (repeat 5000 (mk_3dp plst) (entdel (entlast)) ) (prompt "\n\'nmk_3dp\' Elapsed time (5000 iterations) : ") (princ (rtos (/ (- (car (_vl-times)) tmp) 1000.0) 2 50)) (prompt " seconds.") (princ) ) The execution times for each version can be seen in the following image: Your modification of 'f3DPol' actually seems to be even slower. And 'mk_3dp' is only about 20% faster. What's going on?
  19. Steven P

    Setting HPANNOTATIVE

    Create a LISP file - a blank notepad file if you want, saved as "MyStartUpLisps.LSP" remembering to change the file type from *.txt to *.* (or whatever name you want). Save this in a 'Trusted location', or somewhere else - I tend to use my personal company space, won't change if AutoCAD changes where trusted Locations are or when my laptop is replaced. If using somewhere other than a trusted location go to AppLoad - StartUp Suit Contents and add the file to start up suit. There in the file anything you want to control at start up, these don't need to be contained in a function, just the commands and when the file loads they are read and applied Add: (setvar 'HPANNOTATIVE 1) I might also add in my preferred snaps and other variables, open a drawing and set snaps to on and ortho
  20. Generally if I am plotting it is much quicker to get a LISP to do all the 'hard' work going through the dialogue box - more so with PDFs where it wants you to select folders to plot to. If these are all standard 90% of the time like BigAl says, go straight to plot. Might be that the most efficient way would be 4 functions to plot to PDF: 'PlotPdf' 'PlotPdfTr' - Transparency 'PlotPdfLW' - Lineweight 'PlotPdfTrLw' - Transparency and lineweight, (or 5th one PlotPDFLwTr to cover it going the options entered in reverse) All call the same basic function passing the required data for example: (defun c:plotpdf ( / )(plotPDF (list 0 0))) ;; List: TR, LW (defun c:plotpdfTr ( / )(plotPDF (list 1 0))) ;; List: TR, LW (defun c:plotpdfLw ( / )(plotPDF (list 0 1))) ;; List: TR, LW (defun c:plotpdfTrLW ( / )(plotPDF (list 1 1))) ;; List: TR, LW (defun c:plotpdfLWTr ( / )(plotPDF (list 1 1))) ;; List: TR, LW (defun PlotPDF ( MyControls / .....) .... ... (if (= (nth 0 MyControls) 1) (setq DoTransparency "Yes")) ... (if (= (nth 1 MyControls) 1) (setq DoLineWeight "Yes")) .... ) I use a similar thing: PlotA0, PlotA1.... for different papersizes, plotpdfmsc (plot PDF Mono Save Close) as examples, easy to remember (can do the 'code' part of the functions backwards too, eg, PLotPDFCS - Close Shave) I tend to pass the controls as a list so that if you want to add more functions later you only need to change the main function and anything new afterwards, for example c:plotpdfPr where Pr might be 'show preview' and that list might be (plotPDF (list 0 0 1)) noting that shorter lists will just return a 'nil' in the if statements / conds so have no effect
  21. Ideas on how to set hpannotative to 1 at drawing opening? I have done multiple startups setting the variable to 1 in the acaddoc.lsp to no avail.
  22. SKID.dwg
  23. Hope someone can help me with this. When I have a Viewport with the object shown as shaded any text I type in the layout tab inside that viewport disappears behind the viewport. In the drawing I attached you can see a schedule behind the viewports. I have to have those objects as shaded. Is there anyway to have the text not disappear if its in the viewport area? SKID.dwg
  24. Why not just use princ to write the text in command line, then select it, ctrl+c and ctrl+v? For e.g. (setq a "213" b "abs" c "ddd") (princ (strcat a " " b " " c)) (princ) ------------------------------- result: 213 abs ddd (select then in command line and paste it)
  25. I think saving the string to a temporary text file and importing it when needed for insertion should accomplish the task.
  26. Hi @BIGAL! I did not explore the option of going straight away to the PDFing. The reason is most likely that sometimes we need to tweak the settings (turn transparency on, or object lineweight). So my idea was to have the lisp extract the Drawing name components (Dwg.Number-Status-Revision-Dwg.Name) and save it in the clipboard so the user can paste it in the dialogbox when saving the drawing. The shell solution seemed pretty good and it does work on the full cad but did not work on LT. @Lee Mac maybe you have some thoughts on this? @BIGAL thanks you so much for being so helpful!
  27. ScottMC

    Segments of polylines

    Really nice Marko! Handy cleaning tool, really does help. Thanks again
  28. In your addition the F3dpol subroutine will be quite slow for path with many vertices due to the (apply (function append) pts) actually 4 times slower than mk_3dp. If you insist on going visual lisp the following would be faster by a factor of 2. Note that variable beginning ith a # are global. So variable #acdoc and #acspc are created at beginning of program with: (or #acdoc (setq #acdoc (vla-get-activedocument (vlax-get-acad-object)))) (setq #acspc (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace #acdoc) (vla-get-ModelSpace #acdoc))) ;Added by GLAVCVS Modified by ymg (defun f3Dpol (plst / sa i p element sa obj ) (setq sa (vlax-make-safearray vlax-vbDouble (cons 0 (1- (* (length plst) 3))))) (setq i 0) (foreach p plst (foreach element p (vlax-safearray-put-element sa i (float element)) (setq i (1+ i)) ) ) (setq obj (vla-Add3DPoly #acspc sa)) (vla-put-Color obj #Pathcol) (vla-put-lineweight obj #Pathlwt) ) Here is mk_3dp: ;; ; ;; mk_3dp by Alan J Thompson ; ;; ; ;; Argument: lst, A list of points (2d or 3d) ; ;; ; ;; Create an 3dPolyline ; ;; Return: Polyline ename ; ;; ; (defun mk_3dp (lst / vtx) (if (and (> (length lst) 1)) (progn (entmakex (list '(0 . "POLYLINE") '(10 0. 0. 0.) (cons 8 #Pathlay) (cons 62 #Pathcol) (cons 370 #Pathlwt) '(70 . 8) ) ) (foreach vtx lst (entmakex (list '(0 . "VERTEX") (cons 10 vtx) '(70 . 32) ) ) ) (cdr (assoc 330 (entget (entmakex '((0 . "SEQEND")))))) ) ) ) And find below Benchmark result _$ (benchmark '((mk_3dp lst) (f3dpol lst))) Benchmarking ...............Elapsed milliseconds / relative speed for 4096 iteration(s): (MK_3DP LST).....1672 / 1.92 <fastest> (F3DPOL LST).....3218 / 1 <slowest> _$
  1. Load more activity
×
×
  • Create New...