lisp to create sectionline using "SECTIONLINES" command and a list of polyline vertices points

aridzv
edited June 3 in LISP

Hi.

I need help with wirting a lisp that takes polyline vertices and use them to create sectionline using the "SECTIONLINES" command.

I wrote a lisp to select a polyline and get its vertices points in to a list - see attached aa.lsp,

also attached is a simple drawing with tin surface and a polyline that I want to use to create the sectionline,

And a short video shows what I'm trying to do with lisp.

thanks,

aridzv.

Comments

  • You have posted before about long sections etc and again can only suggest the hours involved in programming an answer, the task is only like step two of make road long section and cross sections. A reinventing of the wheel.

    Given by the time I have typed this "Civil Site Design" would have made a long section worked out cross sections at interval or points or both, then plotted layouts using company title block, with the section plan view, and matching long section, plus cross section layouts. You have to look at software cost v's productivity gain. If it takes 2 minutes v's 1/2 hour how much money have you saved. Don't forget all the other features in the software we have not discussed the road design aspect of this project.

  • I don't do roads design or other heavy civil desgin tasks,

    so I don't need an app like "civil site designs" and definitely not going to pay for one.

    I do need to use long sections,

    And Bricscad pro offers a native tools to do so, and I'm trying to utilize those tools.

  • Hey @aridzv,

    maybe this is what you had in mind? Basically just call the no dialog command in this case and feed the points in.

  • aridzv
    edited June 4

    @andrejm

    Yes,

    Thanks!!

    Edit:

    I've aded one more (command "")at the end to exit the command with out the command asking for a next point.

    thanks again!!

  • aridzv
    edited June 4

    OK,

    Moving to the next step…

    now I'm trying to use "_.SECTIONVIEWS" command in the lisp to move directly to create the section view.

    if I use this independent lisp code to manually select insertion point and sectionline object,

    it will create the section view.

    (setq inpt (getpoint))

    (setq scent (car (entsel))

    (command "_.SECTIONVIEWS" scent "_M" inpt)

    and when using (entget scent)I get the 0. code as (0 . "BsysCvDbSectionLine")wich is a sectionline object.

    if I try to use (entget (entlast)) after creating the sectionline with the original lisp,

    either within the lisp or right after it finished,

    I get (0 . "BsysCvDbSectionLineLabel") for that entity, meaning it is the sectionline label and not the object itself,

    so I can't use it in "_.SECTIONVIEWS" command".

    Is there a way to get the "SECTIONLINE" object in the lisp after creating it so I will be able to move directly to select insertion point for sectionview and create it?

    Thanks,

    aridzv.

  • Hello.

    An approach could be to use (entlast) before starting the procedure, to have a reference to the last created entity.

    Then create the section line.

    In the end, (entnext) could be used to loop through the newly created entities.
    If the procedure succeeded - meaning, the section line is created, one of the new entities is the section line.
    It can be identified by using the dxf code 0.

  • @Virgil

    Thanks!!

    that worked.

    attached the final (for now…) lisp.

    aridzv.