How to jig the multiple entities (Not full entity..Part/Portion of entity)(Polyline+Block) with C#

How to jig the multiple entities (Not full entity..Part/Portion of entity)(Polyline+Block) with C#

b_karunakar75
Participant Participant
1,209 Views
12 Replies
Message 1 of 13

How to jig the multiple entities (Not full entity..Part/Portion of entity)(Polyline+Block) with C#

b_karunakar75
Participant
Participant

If the multiple polylines are connected at one block..i need to jig the block and some portion of the polyline which cover close to the block

0 Likes
1,210 Views
12 Replies
Replies (12)
Message 2 of 13

fieldguy
Advisor
Advisor

what code do you have so far? can you provide screen shots of what you are trying to accomplish - before and after?

0 Likes
Message 3 of 13

b_karunakar75
Participant
Participant

jig1.PNGjig2.PNG

 

public class AcSpliceMoveJig : EntityJig
    {
        List<Polyline> _Entities;
        Polyline m_pline;
        Point3d m_point;
        int m_index;
        Vector3d m_vector;
        double m_bulge;
        double m_sWidth;
        double m_eWidth;
        int _ecnt;
        //BlockReference m_Br;

        public  AcSpliceMoveJig(Polyline pline, Point3d point,List<Polyline> plinelst,int index, Vector3d vector, double bulge, double sWidth, double eWidth)
                     : base(pline)
        {
            //m_pline = pline;
            _Entities = plinelst;
            m_point = point;
            m_index = index;
            m_vector = vector;
            m_bulge = bulge;
            m_sWidth = sWidth;
            m_eWidth = eWidth;
            _ecnt = 0;
            //m_Br = br;
        }

 

0 Likes
Message 4 of 13

fieldguy
Advisor
Advisor

do you have code where the user selects something? what is the selection criteria? is it always 2 polylines joined at a block insert?

maybe you can move the block by itself and change the endpoints after a successful jig (first pline vertex of p2 and last vertex of p1).

there are several examples available of block jig.

https://www.keanw.com/2015/05/jigging-an-autocad-block-with-attributes-using-net-redux.html 

https://www.keanw.com/2007/05/using_a_jig_fro.html 

0 Likes
Message 5 of 13

b_karunakar75
Participant
Participant

Here user will select the block entity..Then getting the connected poly lines by relation.one or more poly lines connected at the block.i want a jig functionality which will work with poly lines and block all at the same time as i mentioned in the screenshot.

0 Likes
Message 6 of 13

b_karunakar75
Participant
Participant

Means how to pass the multiple entities(poly lines and block) to the entity jig

0 Likes
Message 7 of 13

norman.yuan
Mentor
Mentor

Since your goal is to modify existing entities (changing the block reference's Position and the start/end points of connected lines/end segment of polylines, you would be DrawJig, not EntityJig. You could also easily do it by handling Editor.PointMonitor event during the call of Editor.GetPoint(), where you drawing Transient graphics to visually show the hint of entities being moved.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 8 of 13

b_karunakar75
Participant
Participant
If any code plz share with me.
0 Likes
Message 9 of 13

norman.yuan
Mentor
Mentor

I'll see if I can find a bit of time later today, or tomorrow.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 10 of 13

norman.yuan
Mentor
Mentor

As usual, I posted fully working code with companion video clip here:

 

https://drive-cad-with-code.blogspot.com/2023/03/using-custom-jig-to-transform-group-of.html 

 

Hope it helps.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 11 of 13

b_karunakar75
Participant
Participant

Hi..It is working fine for poly lines connected/ended at the block position.but if the block is at somewhere on the poly line it need ti get the before and after vertices from the block..This case not working fine.

0 Likes
Message 12 of 13

b_karunakar75
Participant
Participant

jig3.PNGjig4.PNG

0 Likes
Message 13 of 13

norman.yuan
Mentor
Mentor

Well, the original question is about jigging multiple entities, thus I suggested DrawJig or custom "Jig" with Transient/Editor.PointMonitor. Now that my article demonstrates how to "jig" multiple entities, it should not be difficult to figure it out how to change the lines/polylines that connect to the block's insertion point in different way.

 

Now that I promised I might post code with a subclassed DrawJig, I decided do it with polylines connected to the block insertion point in different ways. So, go to here to read my second post on this topic:

 

https://drive-cad-with-code.blogspot.com/2023/03/using-custom-jig-to-transform-group-of_21.html 

 

 

Norman Yuan

Drive CAD With Code

EESignature