Modify Endpoint Help

Modify Endpoint Help

Jonathan3891
Advisor Advisor
997 Views
13 Replies
Message 1 of 14

Modify Endpoint Help

Jonathan3891
Advisor
Advisor

Unfortunately I don't have anything started to critique. I cant seem to find anything that is similar to what I'm trying to accomplish. So I'm turning to the experts here to point me in the right direction.

 

The easiest way to describe what I'm tying to do is break it down into workflow:

Select Object(s)

Pick endpoint to modify 

Enter Distance

Move object(s) endpoint in the z axis only by the distance entered

 


Jonathan Norton
Blog | Linkedin
0 Likes
998 Views
13 Replies
Replies (13)
Message 2 of 14

marko_ribar
Advisor
Advisor

Is this for 3DPOLYLINE?

If so, you have to collect all vertices via (entnext) or (vla-get-coordinates) and then entmod that VERTEX coordinate (assoc 10), finally you refresh main parent entity (entupd (cdr (assoc -1 (entmod 3dpolyDXFdata))))...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 14

hak_vz
Advisor
Advisor

@Jonathan3891Is this what you are looking for?

 

Function changes picked point of line or 3dpolyline for some delta Z.

 

 

(defun c:changeEndpointZ ( / e eo del coords np sp ep vlapt)
(defun take (amount lst / ret) (repeat amount (setq ret (cons (car lst) (take (1- amount) (cdr lst))))))
	(cond 
		((and(setq e (car (entsel "\nSelect linea type object <LINE | 3DPOLYLINE>"))))
			(setq eo (vlax-ename->vla-object e))
			(cond 
				((or(= (vlax-get eo 'ObjectName)"AcDbLine")(= (vlax-get eo 'ObjectName)"AcDb3dPolyline"))
					(setq pt (getpoint "\nSelect endpoint to change Z coordinate > "))
					(setq del (getdist "\nInput endpoint delta Z >"))
					(cond 
						((and del (= (vlax-get eo 'ObjectName) "AcDbLine"))
							(if (= (apply '+  (mapcar '- pt (vlax-get eo 'Endpoint))) 0)
								(vlax-put eo 'Endpoint (mapcar '+ (vlax-get eo 'Endpoint) (list 0 0 del)))
								(vlax-put eo 'StartPoint (mapcar '+ (vlax-get eo 'StartPoint) (list 0 0 del)))
							
							)
							(vlax-put eo 'Endpoint (mapcar '+ (vlax-get eo 'Endpoint) (list 0 0 del)))
						)
						((and del (= (vlax-get eo 'ObjectName) "AcDb3dPolyline"))
							(setq 
								coords (vlax-get eo 'Coordinates) np (/ (length coords) 3)
								np (/ (length coords) 3)
								ep (reverse(take 3 (reverse coords)))
								sp (take 3 coords)
								vlapt (vlax-make-safearray vlax-vbdouble '(0 . 2))
							)
							(if (= (apply '+ (mapcar '- pt ep)) 0)
								(progn (vlax-safearray-fill vlapt (mapcar '+ ep (list 0 0 del))) (vla-put-coordinate eo (- np 1) vlapt))
								(progn (vlax-safearray-fill vlapt (mapcar '+ sp (list 0 0 del))) (vla-put-coordinate eo 0 vlapt))
							)
							
						)
						
					)
				)
				(T (princ "\nSelected object is not a line or 3dpolyline entity!"))
			)
		)
	)
(princ)
)

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 4 of 14

Jonathan3891
Advisor
Advisor

@marko_ribar wrote:

Is this for 3DPOLYLINE?

If so, you have to collect all vertices via (entnext) or (vla-get-coordinates) and then entmod that VERTEX coordinate (assoc 10), finally you refresh main parent entity (entupd (cdr (assoc -1 (entmod 3dpolyDXFdata))))...


Its actually a Advance Steel element.


Jonathan Norton
Blog | Linkedin
0 Likes
Message 5 of 14

hak_vz
Advisor
Advisor

@Jonathan3891 wrote:


Its actually a Advance Steel element.


I don't use Advance Steel so ad to your next post dumped properties of desired elements?

 

 

(vlax-dump-object (vlax-ename->vla-object (car(entsel "\nSelect object"))))

 

 

Next time please be more specific with your request, this is not your first request to this forum and you probably know how things work.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 6 of 14

devitg
Advisor
Advisor

@Jonathan3891 For better understanding, and maybe get further help, please upload such sample.dwg

0 Likes
Message 7 of 14

Kent1Cooper
Consultant
Consultant

@Jonathan3891 wrote:

....

Select Object(s)

Pick endpoint to modify 

Enter Distance

Move object(s) endpoint in the z axis only by the distance entered



If you're picking the object, picking the point, and entering the distance, you don't need a routine which won't really save you any steps.  Just pick the object, pick the grip at the point in question, and type in @0,0,YourZaxisDistance, and it will move there if eligible to [e.g. not a LWPolyline vertex because you can't take a vertex out of the plane of the rest of it, but it will work on a Line, a 3DPolyline, a Circle center, Text insertion point, etc.].  The distance can be positive or negative.  You'll need to have Osnap off if any running mode(s) would "see" the original location of the point and snap back to it.

Kent Cooper, AIA
0 Likes
Message 8 of 14

Jonathan3891
Advisor
Advisor

@Kent1Cooper wrote:

@Jonathan3891 wrote:

....

Select Object(s)

Pick endpoint to modify 

Enter Distance

Move object(s) endpoint in the z axis only by the distance entered



If you're picking the object, picking the point, and entering the distance, you don't need a routine which won't really save you any steps.  Just pick the object, pick the grip at the point in question, and type in @0,0,YourZaxisDistance, and it will move there if eligible to [e.g. not a LWPolyline vertex because you can't take a vertex out of the plane of the rest of it, but it will work on a Line, a 3DPolyline, a Circle center, Text insertion point, etc.].  The distance can be positive or negative.  You'll need to have Osnap off if any running mode(s) would "see" the original location of the point and snap back to it.


 

@Kent1Cooper That's how I've been doing it. Just wanted to see if it was something that could be done via lisp.

Is it possible to pick near the side that's to be adjusted, similar to your toggle dim extension lisp?


Jonathan Norton
Blog | Linkedin
0 Likes
Message 9 of 14

Jonathan3891
Advisor
Advisor

@hak_vz wrote:

@Jonathan3891 wrote:


Its actually a Advance Steel element.


I don't use Advance Steel so ad to your next post dumped properties of desired elements?

 

 

 

(vlax-dump-object (vlax-ename->vla-object (car(entsel "\nSelect object"))))

 

 

 

Next time please be more specific with your request, this is not your first request to this forum and you probably know how things work.


 

 

Select object; IAcadEntity: AutoCAD Entity Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff6b8e22ec0>
;   Document (RO) = #<VLA-OBJECT IAcadDocument 000002bfe0d3ba98>
;   EntityTransparency = "ByLayer"
;   Handle (RO) = "356"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000002bfe105adb8>
;   Layer = "Vertical Bracing"
;   Linetype = "ByLayer"
;   LinetypeScale = 20.0
;   Lineweight = -1
;   Material = "ByLayer"
;   ObjectID (RO) = 46
;   ObjectName (RO) = "AstBeamRepr"
;   OwnerID (RO) = 47
;   PlotStyleName = "ByLayer"
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 000002bfe105c010>
;   Visible = -1
T

 

 


Jonathan Norton
Blog | Linkedin
0 Likes
Message 10 of 14

Kent1Cooper
Consultant
Consultant

So that list of VLA properties doesn't seem to include anything about points that could have new values assigned to them.  What is its entity data list like?  That is, what does this return?

 

(entget (car (entsel "\nSelect object: ")))

 

Or, another kind of list of properties, in case it reveals anything a routine could work with:

 

(dumpallproperties (car (entsel "\nSelect object: ")))

Kent Cooper, AIA
0 Likes
Message 11 of 14

Jonathan3891
Advisor
Advisor

@Kent1Cooper wrote:

So that list of properties doesn't seem to include anything about points that could have new values assigned to them.  What is its entity data list like?  That is, what does this return?

 

(entget (car (entsel "\nSelect object: ")))

 

Or, another kind of list of properties, in case it reveals anything a routine could work with:

 

(dumpallproperties (car (entsel "\nSelect object: ")))


Here it is

Select object: ((-1 . <Entity name: 2bfe18ca5e0>) (0 . "ASTBEAM") (330 . <Entity name: 2bfe18c61f0>) (5 . "356") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "Vertical Bracing") (48 . 20.0))

Jonathan Norton
Blog | Linkedin
0 Likes
Message 12 of 14

Jonathan3891
Advisor
Advisor

 

Select object: Begin dumping object (class: AstBeamRepr)
Annotative (type: bool)  (LocalName: Annotative) = Failed to get value
AnnotativeScale (type: AcString)  (RO)  (LocalName: Annotative scale) = Failed to get value
Approval comment (type: AcString)  (RO) = -
Approval status (type: AcString)  (RO) = Not Set
Approval status code (type: AcString)  (RO) = -
Assembly mark (type: AcString)  (RO) = -
BlockId (type: AcDbObjectId)  (RO) = 2bfe18c61f0
Carrier (type: AcString)  (RO) = -
CastShadows (type: bool) = 1
ClassName (type: AcString)  (RO) =
Coating (type: AcString)  (RO) = None
CollisionType (type: AcDb::CollisionType)  (RO) = 1
Color (type: AcCmColor)  (LocalName: Color) = BYLAYER
Commodity number (type: AcString)  (RO) = -
Confidence (type: AcString)  (RO) = None
Construction class (type: AcString)  (RO) = None
Delivery date (type: AcString)  (RO) = -
Detail class (type: AcString)  (RO) = None
Exact weight (type: AcString)  (RO) = 46.92
ExtensionDictionary (type: AcDbObjectId)  (RO) = 0
Fabrication station (type: AcString)  (RO) = -
Free remark (type: AcString)  (RO) = -
Handle (type: AcDbHandle)  (RO) = 356
HasFields (type: bool)  (RO) = 0
HasSaveVersionOverride (type: bool) = 0
Heat number (type: AcString)  (RO) = -
Hyperlinks (type: AcDbHyperlink*)
IsA (type: AcRxClass*)  (RO) = AstBeamRepr
IsAProxy (type: bool)  (RO) = 0
IsCancelling (type: bool)  (RO) = 0
IsEraseStatusToggled (type: bool)  (RO) = 0
IsErased (type: bool)  (RO) = 0
IsModified (type: bool)  (RO) = 0
IsModifiedGraphics (type: bool)  (RO) = 0
IsModifiedXData (type: bool)  (RO) = 0
IsNewObject (type: bool)  (RO) = 0
IsNotifyEnabled (type: bool)  (RO) = 0
IsNotifying (type: bool)  (RO) = 0
IsObjectIdsInFlux (type: bool)  (RO) = 0
IsPersistent (type: bool)  (RO) = 1
IsPlanar (type: bool)  (RO) = 0
IsReadEnabled (type: bool)  (RO) = 1
IsReallyClosing (type: bool)  (RO) = 1
IsTransactionResident (type: bool)  (RO) = 0
IsUndoing (type: bool)  (RO) = 0
IsWriteEnabled (type: bool)  (RO) = 0
L section [%s]: (type: AcString)  (RO) = 2550.1
L system [%s]: (type: AcString)  (RO) = 2550.1
LayerId (type: AcDbObjectId)  (LocalName: Layer) = 2bfe18a4900
LineWeight (type: AcDb::LineWeight)  (LocalName: Lineweight) = -1
LinetypeId (type: AcDbObjectId)  (LocalName: Linetype) = 2bfe18c6150
LinetypeScale (type: double)  (LocalName: Linetype scale) = 20.000000
Load Number (type: AcString)  (RO) = -
LocalizedName (type: AcString)  (RO) =
Lot/Phase (type: AcString)  (RO) = -
Material (type: AcString)  (RO) = S355JR
MaterialId (type: AcDbObjectId)  (LocalName: Material) = 2bfe18c6640
MergeStyle (type: AcDb::DuplicateRecordCloning)  (RO) = 1
Model Role (type: AcString)  (RO) = None
Name (type: AcString)  (RO) = TN150x150x6.5x9
ObjectId (type: AcDbObjectId)  (RO) = 2bfe18ca5e0
OwnerId (type: AcDbObjectId)  (RO) = 2bfe18c61f0
PO number (type: AcString)  (RO) = -
PlotStyleName (type: AcString)  (RO)  (LocalName: Plot style) = ByColor
Pre defined remark (type: AcString)  (RO) = -
Preliminary mark (type: AcString)  (RO) = -
Profile (type: AcString)  (RO) = TN150x150
ReceiveShadows (type: bool) = 1
Requisition number (type: AcString)  (RO) = -
Section class (type: AcString)  (RO) = China T
ShadowDisplay (type: AcDb::ShadowFlags)  (LocalName: Shadow Display) = 0
Shipped date (type: AcString)  (RO) = -
Shrink (draw) (type: AcString)  (RO) = 0.0
Single part mark (type: AcString)  (RO) = -
Supplier (type: AcString)  (RO) = -
Transparency (type: AcCmTransparency)  (LocalName: Transparency) = 0
Type (type: AcString)  (RO) = Straight beam
User Attribute 01 (type: AcString)  (RO) = -
User Attribute 02 (type: AcString)  (RO) = -
User Attribute 03 (type: AcString)  (RO) = -
User Attribute 04 (type: AcString)  (RO) = -
User Attribute 05 (type: AcString)  (RO) = -
User Attribute 06 (type: AcString)  (RO) = -
User Attribute 07 (type: AcString)  (RO) = -
User Attribute 08 (type: AcString)  (RO) = -
User Attribute 09 (type: AcString)  (RO) = -
User Attribute 10 (type: AcString)  (RO) = -
Visible (type: AcDb::Visibility) = 0
Weight (type: AcString)  (RO) = 46.92
End object dump​

 


Jonathan Norton
Blog | Linkedin
0 Likes
Message 13 of 14

Kent1Cooper
Consultant
Consultant

Neither that entity data list nor the dumped properties appears to contain anything about points that could have new values assigned, so an AutoLisp routine, at least, may not be an option.  There's an Advance Steel Forum where you could ask.

Kent Cooper, AIA
Message 14 of 14

Jonathan3891
Advisor
Advisor

Thanks @Kent1Cooper !

 


Jonathan Norton
Blog | Linkedin
0 Likes