TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: LUCAS on February 22, 2006, 08:55:46 PM

Title: Why use difference methods have difference insert point of the block?
Post by: LUCAS on February 22, 2006, 08:55:46 PM
Sorry! AutoCAD is a Chinese version
Why use difference methods have difference insert point of the block?

command: (entget (car (entsel)))

選取物件: ((-1 . <圖元名稱: 7ef73f10>) (0 . "INSERT") (330 . <圖元名稱:
7ef73cf8>) (5 . "3BAA") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"PV-786") (100 . "AcDbBlockReference") (2 . "2006020812404743") (10 -4377.46
-944.256 1335.38) (41 . 1.22474) (42 . 1.22474) (43 . 1.22474) (50 . 2.35619)
(70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.816497 0.57735))


command: (vlax-dump-object (vlax-ename->vla-object (car (entsel))))

選取物件: ; IAcadBlockReference: AutoCAD 圖塊參考介面
;性質值:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00b9d604>
;   Document (RO) = #<VLA-OBJECT IAcadDocument 0b581960>
;   Handle (RO) = "3BAA"
;   HasAttributes (RO) = 0
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0b5ca074>
;   InsertionPoint = (4377.46 1635.5 -4.43379e-012)
;   Layer = "PV-786"
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Name = "2006020812404743"
;   Normal = (0.0 0.816497 0.57735)
;   ObjectID (RO) = 2130132752
;   ObjectName (RO) = "AcDbBlockReference"
;   OwnerID (RO) = 2130132216
;   PlotStyleName = "ByLayer"
;   Rotation = 2.35619
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 0b5cbfa0>
;   Visible = -1
;   XScaleFactor = 1.22474
;   YScaleFactor = 1.22474
;   ZScaleFactor = 1.22474
T
Title: Re: Why use difference methods have difference insert point of the block?
Post by: Kerry on February 22, 2006, 09:26:21 PM
(entget (car (entsel))) 
is returning the XYZ relative to the UCS the block was inserted in .

LIST
and  (vlax-dump-object (vlax-ename->vla-object (car (entsel))))
will return the XYZ in the World UCS

and from the NORMAL property of the block, it appears the UCS is a little twisted.


Title: Re: Why use difference methods have difference insert point of the block?
Post by: LUCAS on February 22, 2006, 09:27:07 PM
Ok! I find the answer.
(TRANS '(-4377.46 -944.256 1335.38) '(0.0 0.816497 0.57735) 0)

(4377.46 1635.5 -0.000548232)
Title: Re: Why use difference methods have difference insert point of the block?
Post by: Kerry on February 22, 2006, 09:31:58 PM
oh, just noticed you attached a dwg file too.  I should have looked at that first .. :-)
Title: Re: Why use difference methods have difference insert point of the block?
Post by: Kerry on February 22, 2006, 09:37:05 PM
Why is the insertion point for the block a significant distance away from the block ?
I would expect the insertion point to be at the Center on one face < or middle >
Title: Re: Why use difference methods have difference insert point of the block?
Post by: JohnK on February 23, 2006, 09:26:25 AM
Yeah, that "insertion point" problem usualy happens to me when i create a new "master block for my collection" in one of my working drawings and dont go into the new block drawing and clean it up. (ie move the item, from its insertion point to zero, zero and set the "base" to zero, zero)
Title: Re: Why use difference methods have difference insert point of the block?
Post by: CAB on February 23, 2006, 10:24:15 AM
My impression was that if you create a block & do not pick an Insert Point,
then 0,0 is used and if your block is way out in space the insert point is
way out from the block. Sorry I could not be more descriptive.
Title: Re: Why use difference methods have difference insert point of the block?
Post by: JohnK on February 23, 2006, 12:25:21 PM
Most times, even if you do pick an insertion point. The "block" will end up out in space. I go into each new block i make and make sure the block is at 0,0 and make sure the "base" is at 0,0.