SolidWorks Two Development Learning (1) How to select a sketch and traverse all the lines in the sketch

Source: Internet
Author: User

1 ImportsSolidWorks.Interop.sldworks2 ImportsSolidWorks.Interop.swconst3 ImportsSystem.Runtime.InteropServices4 ImportsSystem5 6 Partial ClassSolidworksmacro7 8      Public SubMain ()9 Ten  One             DimSwdoc asMODELDOC2 = Nothing A             DimSwpart asPartdoc = Nothing -             DimSwdrawing asDrawingdoc = Nothing -             Dimswassembly asAssemblydoc = Nothing the             DimBoolstatus as Boolean=false -             DimLongstatus as Integer=0 -             DimLongwarnings as Integer=0 -Swdoc =CType(SWAPP.ACTIVEDOC,MODELDOC2) +Boolstatus = SwDoc.Extension.SelectByID2 ("Air_up_sketch","SKETCH",0,0,0,False,0, Nothing,0) - Swdoc.editsketch () +Swdoc.clearselection2 (True) A  at         DimThesketch asSketch -Thesketch =SWDOC.GETACTIVESKETCH2 -         DimVsketchseg as Object -Vsketchseg =thesketch.getsketchsegments -         DimSwsketchseg assketchsegment -         DimK =0 in         If  not IsNothing(VSKETCHSEG) Then -              forK =0  to UBound(VSKETCHSEG) toSwsketchseg =vsketchseg (k) +Swsketchseg.selectbymark (True,0) -             Nextk the         End If *  $ Panax Notoginseng  -     End Sub the  +     " " <summary> A     " "The sldworks swapp variable is pre-assigned for you. the     " " </summary> +      PublicSwapp asSldworks -  $  $ End Class

SolidWorks Two Development Learning (1) How to select a sketch and traverse all the lines in the sketch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.