I need a Create Xline on line and poly line vertex point Automatic with the help of lisp. Please check my Attached pic to understand my problem.
Solved! Go to Solution.
Solved by tramber. Go to Solution.
Do this :
VX is the command name.
[EDIT]
(defun c:vx (/ *os* obj)
(setq *os*(getvar "osmode"))(setvar"osmode"0)
(cond((setq obj(car(entsel"\nPolyline")))
(command "_xline" "_v")
(foreach p (mapcar 'cdr(vl-remove-if-not '(lambda(x)(=(car x)10))(entget obj)))
(command p))
(command)))
(setvar"osmode"*os*)(princ)
)
I used this code and it give me a lot of help to move my work fast. But I want to request you to modify in the code to give both option on object Horizontal and vertical previously provide code for vertical only on object. Check attached pic now I need horizontal xlines on vertex
(defun c:hx (/ *os* obj)
(setq *os*(getvar "osmode"))(setvar"osmode"0)
(cond((setq obj(car(entsel"\nPolyline")))
(command "_xline" "_h")
(foreach p (mapcar 'cdr(vl-remove-if-not '(lambda(x)(=(car x)10))(entget obj)))
(command p))
(command)))
(setvar"osmode"*os*)(princ)
)
What about the Hx version ?
It's good working perfectly but my request to you make a one code for Horizontal and vertical. Means if user need horizontal on the object code allows to provide Horizontal lines same as vertical.
The choice will be one as per user need. If we need Horizontal some time and some time we need Vertical on the object.
@ishaq03 wrote:
The choice will be one as per user need. If we need Horizontal some time and some time we need Vertical on the object.
It seems simpler to me to have the two commands that have already been defined. When you want horizontal Xlines, use the HX command, and when you want Vertical ones, use the VX command. If you build the direction choice into a single command, then every time you use it you need to answer the prompt about which direction the Xlines should go. Since presumably you know before you start the command which direction you want, just use the appropriate command name, and eliminate the step of answering a direction prompt.
But if you really prefer the single command with a direction option, it can certainly be done.
yes I prefer single command for Horizontal and vertical, If possible kindly provide me as soon as possible.
Message 1 refers to drawings Xlines at Lines as well as Polyline vertices. Is that something you would need to do, presumably with an Xline [in whatever direction] through each end of each Line selected?
If you want an example of offering such options and retaining one as a default, Search the Customization Forum for CONSTLINES.LSP with its RX command. It has choices for Horizontal, Vertical, Free direction or any specified angle, and remembers your choice to offer as default on subsequent use. But it requires you to pick for each one -- automating it to use every vertex of a Polyline or each end of a Line should not be difficult.
Kent Cooper, Which Command you suggest me it's not create the xlines on Polyline Vertex Point. I need a Code which can be create xline on Polyline Vertex Horizontal and Vertical as user need. Previously I have been get the VX for vertical and RX for Horizontal just my request is Combined this code and Provide a One Command.
Can't find what you're looking for? Ask the community or share your knowledge.