7 Replies Latest reply on Sep 30, 2018 6:14 AM by Deepak Gupta

    Marco to create lines  on drawing view

    Robert H.

      i think am missing something in my understanding of what solidworks when it create line on drawing view or some other stupid mistake,

       

      The idea is simple to draw lines between the START ,  MID , END   of TWO LINES  for now,  - am having an issue when Creating a Line , it competently miss the point  or rendered the line in 3D instead of 2d.

       

      am really confused

        • Re: Marco to create lines  on drawing view
          Robert H.

          after playing around , i think it might have to to with not selecting a plane to drawn on, although have no idea how to define that  !

            • Re: Marco to create lines  on drawing view
              Deepak Gupta

              How is this macro supposed to work?

                • Re: Marco to create lines  on drawing view
                  Robert H.

                  to put it simple it  draws line between two points

                   

                   

                  select a line of of a drawing view  then run programme, program get the position of the   end mid and start position , then  prompts for select second line

                  and process this for the same information then,  and then its selected positions are pass into this function to draw a line CreateCenterLine()  - the problem i am having is that it not working in three dimensions instead of two dimensions

                   

                  i am aware of the doubles, and have removed the times 1000  , it need a lot of clean up (which i will do once it works as expected ) , sorry about that !

                    • Re: Marco to create lines  on drawing view
                      Deepak Gupta

                      Robert H. wrote:

                       

                       

                      select a line of of a drawing view then run programme, program get the position of the end mid and start position , then prompts for select second line and process this for the same information then, and then its selected positions are pass into this function to draw a line CreateCenterLine() - the problem i am having is that it not working in three dimensions instead of two dimensions

                      I do not see anything in the code which prompts me to select second line or even draw a line. Can you explain in more details with example as what are you trying to achieve?

                        • Re: Marco to create lines  on drawing view
                          Robert H.

                          updated version should make it clearer, with prompt   sorry i got sidetracked with something else, the marco drawn the line , sorry - i haven't make it very user friendly yet 

                           

                          prompt window will pop up then click on line then,  select next line (see attached sceenshot)  and the program will then go on to drawn a line between them , although it does it in 3d not 2d !

                           

                          basically i wanted to Crete a macro that would mark up the door opening directions using the two lines  the first line to get the mid pos , then the get the pos for the end and the start  potion and draw a line from the second line  start pos to the first line mid pos back to the second line end pos ,  see second image

                  • Re: Marco to create lines  on drawing view
                    Robert H.

                    after some messing around i think i have figured it out, there a difference between the position collected and implementing the position  it seams solidworks, doesn't use the true axis 0 when implementing the  CreateCenterLine() function, but goes of the bounding box area thus offsetting, if the model is lop side and or has a base base the two don't match up