Search the Community
Showing results for tags 'assoc'.
-
Autolisp giving error: bad argument type: "LINE" when trying to get line type
Erroreki posted a topic in AutoLISP, Visual LISP & DCL
Hi! Avid reader of the forums, first time poster. I have a code with which I'm trying to extract the x and y coordinate of the startpoint of a line to the clipboard for pasting into another program. The problem is that when I run the lisp in Civil 3D it spits out when running (caddr typelst) on line 6 in the code below. What could cause this. I'm having trouble understanding why it wouldn't be able to grab the type from the list. The code: (vl-load-com) (defun c:copyx1y1 () (setq choice (entsel "Choose the line whose start X and Y you want to copy \n")) (setq entname (car choice)) (setq typelst (assoc 0 (entget entname))) (if (= (caddr typelst) "LINE") (progn (setq startpnt (assoc 10 (entget entname))) (setq x1 (cadr startpnt)) (princ "\n") (princ x1) (princ "\n") (setq y1 (caddr startpnt)) (princ y1) (setq copiedtxt (strcat (rtos x1) "\t" (rtos y1))) (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'SetData "Text" copiedtxt) ) (vlax-release-object htmlfile) copiedtxt ) (progn (princ "The choice is not of type LINE") ) ) (princ) ) Regards, E -
Hi, I've tried to look into the differences between DIMS that need to be reassociated and actual associative DIMS. All I can see is that there are two pairs in the DXF 330 listing. Like the '(1 . "AcDbOsnapPointRef")' for example. I'm scratching my head and haven't found a way to do it. I've tried: (setq ss_1 (ssget (list (cons 0 "DIMENSION")(cons 102 "{ACAD_REACTORS")))) But that gets the DIMS that are still not ASSOC. That's probably just the got to do with the DIM style. I know I can use the DIMREASSOCIATE command followed by D but I be zooming in and out like a fiddlers elbow. ACAD doesn't seem to group them close to each other by doing this. Non-ASSOC DIM (-1 . <Entity name: 26849003940>) (0 . "DIMASSOC") (5 . "334A4") (102 . "{ACAD_REACTORS") (330 . <Entity name: 26849003830>) (102 . "}") (330 . <Entity name: 26849003830>) (100 . "AcDbDimAssoc") (330 . <Entity name: 26849003820>) (90 . 2) (70 . 1) (71 . 0) (1 . "AcDbOsnapPointRef") (72 . 1) (331 . <Entity name: 267c7f5bb40>) (331 . <Entity name: 2678711a950>) (73 . 2) (91 . 3) (301 . "32246") (301 . "2DE5D") (40 . 1.0) (10 0.0 0.0 2.0e+50) (75 . 0) ASSOC DIM (-1 . <Entity name: 26849003ad0>) (0 . "DIMASSOC") (5 . "334BD") (102 . "{ACAD_REACTORS") (330 . <Entity name: 26849003990>) (102 . "}") (330 . <Entity name: 26849003990>) (100 . "AcDbDimAssoc") (330 . <Entity name: 26849003980>) (90 . 3) (70 . 1) (71 . 0) (1 . "AcDbOsnapPointRef") (72 . 1) (331 . <Entity name: 267c7f5bb40>) (331 . <Entity name: 2678711a950>) (73 . 2) (91 . 3) (301 . "32246") (301 . "2DE5D") (40 . 1.0) (10 0.0 0.0 2.0e+50) (75 . 0) (1 . "AcDbOsnapPointRef") (72 . 1) (331 . <Entity name: 267c7f5bb40>) (331 . <Entity name: 2678711a950>) (73 . 2) (91 . 2) (301 . "32246") (301 . "2DE5D") (40 . 1.0) (10 0.0 0.0 2.0e+50) (75 . 0)