Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. You need to include the stretch linear parameter in the rotate selection. See attached altered drawing DynBlock101.dwg
  3. Today
  4. I keep running into the same issue with this dynamic block. I need to be able to both stretch and rotate it. But when I rotate it and then try to stretch it I don't get the results I want. As I experiment with the block I find that when I include what I think is needed AutoCAD reports that I have a circular reference in the block. ??? DynBlock101.dwg
  5. lrm

    Beginner needs help...

    I think I misread the problem and assumed you were trying to create a 3D model of the object. It looks like it is an exercise in creating 2D views from other 2D views using the descriptive geometry methods that were created for manual drafting more than a 100 years ago. I'm sure there is some value in doing this in 2018 but I think your time would be better served learning how to build 3D models and making 2d views from them. Enough with my pontificating and back to your front view construction challenge. Your top view is wrong because the auxiliary view from which the rounded portion is created is wrong. The 49 dimension should be 43. You should create the full auxiliary view before finishing the top view. I've added some projection lines to show you how things line up. I made a copy of your auxiliary view (before I noticed the incorrect dimension) and positioned it to the right of the front view and then created some projection lines to the front view. We can determine some critical points and slopes for the half ellipse that is needed for the front view by projecting lines from the top view and my copy of the auxiliary view. In the pencil and paper days we would fudge in an ellipse using an ellipse template from these points and slopes. The easiest way I know to create the magenta ellipse with AutoCAD is to create a head-on view of the shape and then rotate it in 3D. The white shape in the upper left of the drawing is that head on view. I then used rotate3d to rotate the shape first by -35° (90-55) about the x axis and then +40° about the y axis. This resulted in the cyan colored shape to the right of it. Flatten was used to project the result onto the XY plane resulting in the magenta colored shape. Flatten made an ellipse of the arc that was no longer parallel to the xy plane. It was then I discovered the 49 vs. 43 error. I suggest you fix the error in the auxiliar and secondary auxiliary views then us the rotate3d method for creating the ellipse as AutoCAD doesn't feature a method for creating an ellipse using 3 points and 2 slopes. Better yet, create a 3D model of the shape and view it from any angle you desire!
  6. I'm using Civil3D 2014 and keep getting the below error: "FATAL ERROR: Unhandled Access Violation Reading 0x7f3e2c08 Exception at 776fa365h" Any ideas what could be causing it? I can't work for more than a few seconds to minutes at a time before it crashes. This seems to be workstation specific, as my coworker does not have the same issues when opening the same files I'm having trouble with. A couple hours before this error started, I was customizing some shortcuts under Manage>Edit Aliases. Would this have anything to do with the error? I tried changing the customized shortcuts back to their originals, but the error remains.
  7. If that fails, and you have some idea where the code is failing, run it in "vlide" set a break toggle and variable watches and step though the code to see what is happening and why.
  8. Why don't you set 'break on error' and troubleshoot this in the VLIDE ? You're not really giving us much to work with. IMO .. I'd try to remove as many command calls from your code as possible.
  9. You can't set CECOLOR to a list value .. furthermore you cannot use ITOA on a list? ITOA is used to convert an integer to a string. Here is what I think you're trying to accomplish: ;; Written by PBEJSE on CADTutor ;; Post #4 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/multiple-polyline-area-labels/td-p/3459894 ;; Relies on TEXTSIZE variable for text size ;; 280316 - Tharwat updated field properties in post #2 in above link ;; 040416 - Tharwat updated to add hatch based on area ranges (command "-dimstyle" "R" "Standard") (defun c:mfah (/ bitversion acsp ss e ptlist id strfield txt p ar c clr sum verts) (setq ins (getvar "insunits")) (cond ((= (setq ins (getvar "insunits")) 4) ;if insunits=4 then apply 1 x cannoscale (setvar "dimscale" (/ 1.0 (getvar "CANNOSCALEVALUE"))) ) ((= ins 6) ;if insunits=6 then apply 0.001 x cannoscale (setvar "dimscale" (/ 0.001 (getvar "CANNOSCALEVALUE"))) ) ) (setq scale (getvar "DIMSCALE")) (setq ln (strcat "U-TEXT-AREA-" (rtos scale 2 0))) (command "-LAYER" "m" ln "co" "7" ln "p" "p" ln "") (setvar "TEXTSTYLE" "Standard") (setvar "TEXTSIZE" (* 1.8 (getvar "DIMSCALE"))) ;(if (not (or (tblsearch "LAYER" "U-AREA-HTCH-BDRY")))) ; (tblsearch "LAYER" "U-AREA-HTCH") ;(progn ;(command "-layer" "Make" "U-AREA-HTCH-BDRY" "Plot" "No" "" "Colour" "6" "" "description" "Area Hatch Boundary" "U-AREA-HTCH-BDRY" "") ;(command "-layer" "Make" "U-AREA-HTCH" "Colour" "254" "" "description" "AREA Hatch" "U-AREA-HTCH" "") (setq bitversion (> (strlen (vl-prin1-to-string (vlax-get-acad-object))) 40) acsp (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)))) ) (if (setq ss (ssget "_X" '((0 . "*POLYLINE") (-4 . "&") (70 . 1) (410 . "Model")))) (repeat (sslength ss) (setq e (ssname ss 0) sum '(0 0) verts (cdr (assoc 90 (entget e))) ) (setq ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e)))) (foreach x ptlist (setq sum (mapcar '+ x sum))) (setq id (if bitversion (vlax-invoke-method (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))) 'getobjectidstring (vlax-ename->vla-object e) :vlax-false ) (itoa (vla-get-objectid (vlax-ename->vla-object e))) ) strfield (strcat "%<\\AcObjProp Object(%<\\_ObjId " id ">%).Area \\f \"%lu2%pr0%ps[, m²]%ds44\">%" ) txt (vla-addmtext acsp (setq p (vlax-3d-point (mapcar '/ sum (list verts verts)))) 0 strfield ) ) (vla-put-attachmentpoint txt acattachmentpointmiddlecenter) (vla-put-insertionpoint txt p) (setq c nil clr (getvar 'cecolor) ) (if (or (< 185 (setq ar (vla-get-area (vlax-ename->vla-object e))) 190) (< 301 ar 351)) (entmod (append (entget e) '((62 . 244) (420 . 11737633)))) ;;(setq c '((62 . 244) '(420 . 11737633))) ) ;;; (if c ;;; (entmod (append (entget e) c)) ;;; ;; (setvar 'cecolor (itoa c)) ;;; ) (command "_.-HATCH" "_P" "SOLID" "_S" e "" "") (setvar 'cecolor clr) (ssdel e ss) ) (princ "\0 Objects found:") ) (princ) ) (vl-load-com)
  10. maratovich

    DataGrid control?

    There are many other controls. Choose the right one. If you need this, then or Microsoft website or install one of the programs, it is included in the delivery package - https://kdmsoft.net
  11. DavidGraham

    DataGrid control?

    Thanks for the reply. I don't see 'Microsoft Hierarchical FlexGrid' in my additional controls - how do I add it?
  12. Guy Borgford

    LISP works on mine but only partial on others

    I am using command calls, but all users are using AutoCAD 2016. I have asked the users for a " system variables " dump and am going to compare for differences. Thanks Grrr
  13. maratovich

    DataGrid control?

  14. IMO you are placing the cart infront of the donkey - You should try debugging your code, by breaking down its structure into code blocks, and check if the same arguments are passed, One way to easily determine where exactly your program failed is by using the cond function. (cond ( (not (setq args (GetArgumentsFromUser))) (prompt "\nError #1") ) ( (not (setq rslt (ProcessArguments args))) (prompt "\nError #2") (prompt "\nMaybe invalid arguments were passed in 'ProcessArguments' function.") ) ( (not (setq rslt2 (ProcessAgain rslt))) (prompt "\nError #3") ) ( (not (setq tmp (DoingSomeOtherStuff))) (prompt "\nError #4") ) ); cond And like dlanorh said it may be from the lisp or system variables, that your code uses. I've had issue with one of my programs where I used (getvar 'loginname) to construct my dictionary key, but it was dfferent on my other PC. So I used a constant string instead. Another thing could be if you use command calls, the required arguments may be different between the versions, so that requires manual tracing,
  15. Guy Borgford

    LISP works on mine but only partial on others

    Thank you, I am going to try that. I'll let you know. Thanks again dlanorh
  16. You can dump a list of all system variables using "Express Tools" -> "Tools" -> "System Variable Editor" -> saveall button. This will dump all the system variable names and current settings to a text file with the *.svf? extension. Your problem is then comparing other dumps with yours. If this is the problem it is likely a sysvar you haven't taken into account. If you are using global variables to pass info then these need to be as unique as possible. You can include " * , % , $ , - , _ .." into variable names
  17. Guy Borgford

    LISP works on mine but only partial on others

    I have made as many variables "local" as I can. Could there be differences in the systems allowing my computer to store the points (list variables) but not other users systems. How can we compare system set ups? I will be unable to post the code. Also, how I would like to approach this is, match up the other users systems settings etc. to mine. It all works without issues on my system. Could there be a memory setting( in AutoCAD or Windows) that allows my system to save the points/list variables. Is there a way to compare system settings? Thanks for any help on this issue dlanorh
  18. Without seeing the lisp code it is very difficult to assess why it is working on one machine and not another. It could be system variables or non localised variables......etc.
  19. Guy Borgford

    LISP works on mine but only partial on others

    Roy Thanks for reading , but OSMODE will not come into play as the issue occurs mid-LISP . Part way through the LISP (you can watch the scaffold being built on the screen) the items start being inserted in the wrong place (not inserted on an intersection or end point some where "wrong" but inserted at an old "defined point" wrong). When inserting or using a point for orientation the prompt is "specify a point" and CAD waits, if no point is specified by a variable (or if the variable specified has a nil value) CAD hangs in wait for a point to be defined by keyboard entry or mouse click. This problem doesn't occur on my computer, because of that, I think it is a settings issue. (Although I was able to figure out how to write LISP coding in a way that helps my team design much more quickly and efficiently, and have been using Auto CAD for 20 years, I am not well versed at the set up end of things in Auto CAD) I checked the OSMODE setting, and just to verify I will have the team members experiencing issues "suppress all" (toggle OSNAP to off) and check for changes . Thanks again Ron
  20. dlanorh

    help me, please!!! not working

    (vl-file-copy source-file destination-file) This is the correct syntax (setq curr_dir (strcat (getvar "dwgprefix") )) curr_dir is NOT a destination FILE
  21. The obvious answer is : You are not passing a block with attributes and/or that you are not passing a dotted pair list of tags and values to the (LM:setattributevalues) function. See Lee's documentation below ;; Set Attribute Values - Lee Mac ;; Sets attributes with tags found in the association list to their associated values. ;; blk - [vla] VLA Block Reference Object ;; lst - [lst] Association list of ((<tag> . <value>) ... ) ;; Returns: nil (defun LM:vl-setattributevalues ( blk lst / itm ) (foreach att (vlax-invoke blk 'getattributes) (if (setq itm (assoc (vla-get-tagstring att) lst)) (vla-put-textstring att (cdr itm)) ) ) )
  22. Grrr

    DataGrid control?

    I've seen @maratovich using DataGrid in one of his plot programs. He told me that he writes in VB6, so I guess you'll have to use Visual Studio for additional controls.
  23. Thanks Jeff, that is a great and detailed answer - thanks for taking the time to do all of that. I will do what I want this way. I was ideally wanting a solution contained within a single LISP routine (or other programming) that I could just send to colleagues without worrying about them altering any of their settings. but I don't think that is possible. So I will create a different - no preview - PC3 and do things this way.
  24. make them as block if its easyer!
  25. So I tried to use a True Colour like this: (setq c (list '((62 . 244) (420 . 11737633)))) which returns this error: error: bad argument type: fixnump: (((62 . 244) (420 . 11737633))) This is the full code ;; Written by PBEJSE on CADTutor ;; Post #4 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/multiple-polyline-area-labels/td-p/3459894 ;; Relies on TEXTSIZE variable for text size ;; 280316 - Tharwat updated field properties in post #2 in above link ;; 040416 - Tharwat updated to add hatch based on area ranges (command "-dimstyle" "R" "Standard") (defun c:MFAH (/ BitVersion acsp ss e ptList ID StrField txt p ar c clr sum verts) (setq ins (getvar "insunits")) (cond ((= (setq ins (getvar "insunits")) 4) ;if insunits=4 then apply 1 x cannoscale (setvar "dimscale" (/ 1.0 (getvar "CANNOSCALEVALUE")))) ((= ins 6) ;if insunits=6 then apply 0.001 x cannoscale (setvar "dimscale" (/ 0.001 (getvar "CANNOSCALEVALUE")))) ) (setq scale (getvar "DIMSCALE")) (setq ln (strcat "U-TEXT-AREA-"(rtos scale 2 0))) (command "-LAYER" "m" ln "co" "7" ln "p" "p" ln "") (setvar "TEXTSTYLE" "Standard") (setvar "TEXTSIZE" (* 1.8(getvar "DIMSCALE"))) ;(if (not (or (tblsearch "LAYER" "U-AREA-HTCH-BDRY")))) ; (tblsearch "LAYER" "U-AREA-HTCH") ;(progn ;(command "-layer" "Make" "U-AREA-HTCH-BDRY" "Plot" "No" "" "Colour" "6" "" "description" "Area Hatch Boundary" "U-AREA-HTCH-BDRY" "") ;(command "-layer" "Make" "U-AREA-HTCH" "Colour" "254" "" "description" "AREA Hatch" "U-AREA-HTCH" "") (setq BitVersion (if (> (strlen (vl-prin1-to-string (vlax-get-acad-object))) 40) T nil) acsp (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))) (if (setq ss (ssget "_X" '((0 . "*POLYLINE") (8 . "U-AREA-HTCH-BDRY") (-4 . "&") (70 . 1)(410 . "Model")))) (repeat (sslength ss) (setq e (ssname ss 0) sum '(0 0) verts (cdr (assoc 90 (entget e)))) (setq ptList (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e)))) (foreach x ptList (setq sum (mapcar '+ x sum))) (setq ID (if BitVersion (vlax-invoke-method (vla-get-Utility (vla-get-ActiveDocument (vlax-get-acad-object))) 'GetObjectIdString (vlax-ename->vla-object e) :vlax-False) (itoa (vla-get-objectid (vlax-ename->vla-object e)))) StrField (strcat "%<\\AcObjProp Object(%<\\_ObjId " id ">%).Area \\f \"%lu2%pr0%ps[, m²]%ds44\">%") txt (vla-addMText acsp (setq p (vlax-3d-point (mapcar '/ sum (list verts verts)))) 0 StrField) ) (vla-put-AttachmentPoint txt acAttachmentPointMiddleCenter) (vla-put-InsertionPoint txt p) (setq c nil clr (getvar 'CECOLOR)) (cond ((< 185 (setq ar (read (rtos (vla-get-area (vlax-ename->vla-object e)) 2 0))) 190)(setq c (list '((62 . 244) '(420 . 11737633))))) ((< 301 ar 351)(setq c (list '((62 . 244) (420 . 11737633)))));(setq c 170)) ) (if c (setvar 'CECOLOR (itoa c))) (command "_.-HATCH" "_P" "SOLID" "_S" e "" "") (setvar 'CECOLOR clr) (ssdel e ss) )(princ "\0 Objects found:")) (princ) )(vl-load-com)
  26. DavidGraham

    DataGrid control?

    VBA for AutoCAD allows a limited number of controls. I would like to add a DataGrid control and even a menu and toolbar control. Is this possible?
  27. Not sure what you're copying, but if the problem is just pasting to a block (attribute "LEN"), then try this (defun c:ptv (/ reb mrk fm len) (setq fm "%lu2%pr0") (setq reb (vla-get-objectid (vlax-ename->vla-object (car (nentsel "\nSelect the Rebar: "))))) (setq reb (strcat "%<\\AcObjProp Object(%<\\_ObjId "(itoa reb)">%).Length \\f " fm ">%")) (setq len "LEN") (setq reb (list (cons len reb))) ;; These two lines let the client select a subentity (nentsel). ;;(setq mrk (entget (car (nentsel "\nPick the Mark: ")))) ;; This second line then searches for the parent (of the attribute) ;;(setq mrk (vlax-ename->vla-object (cdr (assoc 330 mrk)))) ;; instead this line lets the user select the block itself (entsel) instead of (nentsel) (setq mrk (vlax-ename->vla-object (car (entsel "\nPick the Mark: ")))) (LM:setattributevalues mrk reb) (command "regen") ) ;defun (defun LM:setattributevalues ( blk lst / itm ) (foreach att (vlax-invoke blk 'getattributes) (if (setq itm (assoc (vla-get-tagstring att) lst)) (vla-put-textstring att (cdr itm)) ) ) )
  1. Load more activity
  • Newsletter

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

    Sign Up
×